These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Market data on Tranquility

Author
Alastair Letham
Taylife Inc.
#1 - 2015-01-27 15:04:09 UTC
Hi there,

I am trying to get live market data for my application, I am having a small issue though.

is: https://api.eveonline.com/market/10000002/orders/buy/?type=https://api.eveonline.com/types/683/

the equivalent of:

https://api-sisi.testeveonline.com/market/10000002/orders/buy/?type=https://api-sisi.testeveonline.com/types/683/ ?

I thought that I would be able to use the first one to access data from Tranquility, but when I follow the link it sends to a blank page. While sisi link giving me an auth error, as it should. This makes me think that I am making the uri totally wrong.

Any corrections would be greatly appreciated!
Pete Butcher
The Scope
Gallente Federation
#2 - 2015-01-27 16:21:08 UTC
Alastair Letham wrote:
Hi there,

I am trying to get live market data for my application, I am having a small issue though.

is: https://api.eveonline.com/market/10000002/orders/buy/?type=https://api.eveonline.com/types/683/

the equivalent of:

https://api-sisi.testeveonline.com/market/10000002/orders/buy/?type=https://api-sisi.testeveonline.com/types/683/ ?

I thought that I would be able to use the first one to access data from Tranquility, but when I follow the link it sends to a blank page. While sisi link giving me an auth error, as it should. This makes me think that I am making the uri totally wrong.

Any corrections would be greatly appreciated!


Don't hardcode the uri - fetch the list of regions first and you'll have the correct url next to each one. And you're using authed CREST right?

http://evernus.com - the ultimate multiplatform EVE trade tool + nullsec Alliance Market tool

Alastair Letham
Taylife Inc.
#3 - 2015-01-27 16:41:28 UTC
Pete Butcher wrote:
Alastair Letham wrote:
Hi there,

I am trying to get live market data for my application, I am having a small issue though.

is: https://api.eveonline.com/market/10000002/orders/buy/?type=https://api.eveonline.com/types/683/

the equivalent of:

https://api-sisi.testeveonline.com/market/10000002/orders/buy/?type=https://api-sisi.testeveonline.com/types/683/ ?

I thought that I would be able to use the first one to access data from Tranquility, but when I follow the link it sends to a blank page. While sisi link giving me an auth error, as it should. This makes me think that I am making the uri totally wrong.

Any corrections would be greatly appreciated!


Don't hardcode the uri - fetch the list of regions first and you'll have the correct url next to each one. And you're using authed CREST right?



Here is my a snippet of my code:

$auth = base64_encode($clientid.':'.$secret);

$opts = array('http' =>
array(
'method' => 'GET',
'header' => "Host: https://api.eveonline.com\r\n".
"Authorization: Bearer ".auth."\r\n".
"Accept: application/vnd.ccp.eve.MarketOrderCollection-v1+json\r\n"
)
);

$context = stream_context_create($opts);
$url = 'https://api.eveonline.com/market/10000002/orders/buy/?type=https://api.eveonline.com/types/683/';
$result = file_get_contents($url, false, $context);

Do I need to add a scope to this for authed CREST as with the SSO?

I am unsure what you mean with the region thing? Is it better if have a href instead of the '10000002'?
Pete Butcher
The Scope
Gallente Federation
#4 - 2015-01-27 16:46:47 UTC
Alastair Letham wrote:

Here is my a snippet of my code:

$auth = base64_encode($clientid.':'.$secret);

$opts = array('http' =>
array(
'method' => 'GET',
'header' => "Host: https://api.eveonline.com\r\n".
"Authorization: Bearer ".auth."\r\n".
"Accept: application/vnd.ccp.eve.MarketOrderCollection-v1+json\r\n"
)
);

$context = stream_context_create($opts);
$url = 'https://api.eveonline.com/market/10000002/orders/buy/?type=https://api.eveonline.com/types/683/';
$result = file_get_contents($url, false, $context);

Do I need to add a scope to this for authed CREST as with the SSO?

I am unsure what you mean with the region thing? Is it better if have a href instead of the '10000002'?


In order to fetch the orders, you need to fetch the region list first. Then fetch the details of each region you are interested in. In the result you'll have the url for the orders. Use it instead of creating one yourself. Take a look at this dev blog - it has everything explained in detail: https://developers.eveonline.com/blog/article/nom-nom-tastey-market-data/

http://evernus.com - the ultimate multiplatform EVE trade tool + nullsec Alliance Market tool

Alastair Letham
Taylife Inc.
#5 - 2015-01-27 16:56:06 UTC
Pete Butcher wrote:
Alastair Letham wrote:

Here is my a snippet of my code:

$auth = base64_encode($clientid.':'.$secret);

$opts = array('http' =>
array(
'method' => 'GET',
'header' => "Host: https://api.eveonline.com\r\n".
"Authorization: Bearer ".auth."\r\n".
"Accept: application/vnd.ccp.eve.MarketOrderCollection-v1+json\r\n"
)
);

$context = stream_context_create($opts);
$url = 'https://api.eveonline.com/market/10000002/orders/buy/?type=https://api.eveonline.com/types/683/';
$result = file_get_contents($url, false, $context);

Do I need to add a scope to this for authed CREST as with the SSO?

I am unsure what you mean with the region thing? Is it better if have a href instead of the '10000002'?


In order to fetch the orders, you need to fetch the region list first. Then fetch the details of each region you are interested in. In the result you'll have the url for the orders. Use it instead of creating one yourself. Take a look at this dev blog - it has everything explained in detail: https://developers.eveonline.com/blog/article/nom-nom-tastey-market-data/


Thanks a lot for your help, I will look into it!