0

This worked perfect for all Currencies. I can output all data with '0','1','2',...

$url = 'https://bittrex.com/api/v1.1/public/getmarketsummaries
$response = file_get_contents($url);
$obj = json_decode($response,true);

$marketname = $obj['result'][0]['MarketName'] . '';

And this url is for a single currency with the 'market' string.

https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-neo

But how can i read this?

$url = 'https://bittrex.com/api/v1.1/public/getmarketsummaries?market=btc-neo
$response = file_get_contents($url);
$obj = json_decode($response,true);

$marketname = $obj['result'][0]['MarketName'] . '';

doesn't work!

Any idea?

6
  • it's working for me. Also you have missed ' around $url in both your code :- 1:- prntscr.com/h7xc3i and 2:- prnt.sc/h7xbkg Commented Nov 8, 2017 at 19:10
  • Doesn't work is not a great hint. At least you should bother to post the precise error you got, or the value you get instead of the desired one! The code seems ok. Are you sure that the remote read is succesfull? Commented Nov 8, 2017 at 19:13
  • this one also works:- prntscr.com/h7xe9c And prnt.sc/h7xemi Commented Nov 8, 2017 at 19:17
  • I think doesn't work is : all market are returned, not single one. Commented Nov 8, 2017 at 19:22
  • this url bittrex.com/api/v1.1/public/getmarketsummaries?market=btc-neo don't use market parameter Commented Nov 8, 2017 at 19:28

2 Answers 2

1

from API

Use singular summary instead of summaries to filter on market

$url = 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-neo'
Sign up to request clarification or add additional context in comments.

1 Comment

sorry my mistake.. i also tried with summary. but $marketname is not filled. so i think the reason ist the [0] , because with ?market=btc-neo there is only one currency. ?
0

HAVE IT:

Instead:

$url = 'https://bittrex.com/api/v1.1/public/getmarketsummaries?market=btc-neo';

This:

$url = "https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-neo";

The key was also " instead of '

Thanks to all!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.