Author

Topic: Good start api script exchanges (Read 1257 times)

legendary
Activity: 1148
Merit: 1000
March 26, 2016, 07:21:47 AM
#17
Thx for the scripts!
legendary
Activity: 1148
Merit: 1000
March 18, 2016, 08:42:46 AM
#16
@mocacinno I have send you a pm


I've seen it, i'm on the road ATM, so it's kinda hard to test out code. I'll see if i can give you a solution this weekend Wink

thats oke!  Smiley
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
March 18, 2016, 07:18:39 AM
#15
@mocacinno I have send you a pm


I've seen it, i'm on the road ATM, so it's kinda hard to test out code. I'll see if i can give you a solution this weekend Wink
legendary
Activity: 1148
Merit: 1000
March 18, 2016, 07:06:45 AM
#14
@mocacinno I have send you a pm
legendary
Activity: 1148
Merit: 1000
March 17, 2016, 05:39:35 AM
#13
https://yobit.net/api/3/ticker/nlg_btc
since this doesn't have the json_decode($response,true) part you can check for response success some other way (optional)
change the obj to this:
Code:
$obj['nlg_btc']['Last']
the difference here is that the response is not an array. you just have to give the keys to json to reach what you want.

i haven't heard about the other two exchangers Smiley

edit:
https://alcurex.org/api/market.php?pair=NLG_btc&last=last
Code:
$obj['nlg_btc']['price']

https://safecex.com/api/getmarket?market=NLG/BTC
Code:
$obj['last']

you might wanna check with mocacinno that knows PHP

I got Safecex working, I will look the last 2 Alcurex and Yobit
legendary
Activity: 1750
Merit: 1115
Providing AI/ChatGpt Services - PM!
March 17, 2016, 12:50:58 AM
#12
Have a look at this newly created exchange's API https://gatecoin.com/api very well structured and easy to understand.Not only for trades but they provide customer ticker's like Market analysis and Depth.Request header's are easier to create as well :
Code:
              jqXHR.setRequestHeader("API_PUBLIC_KEY", publicKey);
                            jqXHR.setRequestHeader("API_REQUEST_SIGNATURE", hashInBase64);
                            jqXHR.setRequestHeader("API_REQUEST_DATE", now);
                       

Not sure what exactly you're looking for but this one should serve all the custom needs.
legendary
Activity: 3472
Merit: 10611
March 17, 2016, 12:39:40 AM
#11
https://yobit.net/api/3/ticker/nlg_btc
since this doesn't have the json_decode($response,true) part you can check for response success some other way (optional)
change the obj to this:
Code:
$obj['nlg_btc']['Last']
the difference here is that the response is not an array. you just have to give the keys to json to reach what you want.

i haven't heard about the other two exchangers Smiley

edit:
https://alcurex.org/api/market.php?pair=NLG_btc&last=last
Code:
$obj['nlg_btc']['price']

https://safecex.com/api/getmarket?market=NLG/BTC
Code:
$obj['last']

you might wanna check with mocacinno that knows PHP
legendary
Activity: 1148
Merit: 1000
March 16, 2016, 09:20:47 AM
#10
The last thing I need the php script's for yobit alcurex safecex
legendary
Activity: 1148
Merit: 1000
March 16, 2016, 05:50:07 AM
#9
I have change

Code:
$obj = json_decode($response, true);
echo 'Ƀ '. $obj['result'][0]['Last'] . '
';

to

Code:
$obj = json_decode($response,true);
echo number_format($obj['result'][0]['Last'], 8);

That works  Cool


http://www.guldenpagina.nl
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
March 16, 2016, 04:15:10 AM
#8
As pooya87 said, sprintf would be the best way to do this.
I actually didn't think of this, and advised Bram_vnl to explode the string on "E-", and divide the first ellement of the return array by 10 to the power of [second ellement of the returnarray], but sprintf would be a much better idear  Smiley
legendary
Activity: 3472
Merit: 10611
March 15, 2016, 11:36:24 PM
#7
~~
Bittrex Ƀ 4.74E-6 and I want something like this Bittrex Ƀ 0.00000474


they are both the same 4.74E-6 is the scientific method of showing the number.
by the time of displaying the result in your output you have to just change the "format".

most of the time i do this in c#
Code:
txtOutput.Text = string.Format("{0:0.00000000}",4.74E-6);

i don't know about PHP, so google can help you better:
http://stackoverflow.com/questions/1471674/why-is-php-printing-my-number-in-scientific-notation-when-i-specified-it-as-00
http://stackoverflow.com/questions/10916675/display-float-value-w-o-scientific-notation
legendary
Activity: 1148
Merit: 1000
March 15, 2016, 10:25:50 AM
#6
Thanks for the help from @mocacinno

But I have a question from bittrex api, I have this code

Code:
$url 'https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-nlg';
$response file_get_contents($url);
$obj json_decode($response,true);
echo 
'Ƀ '$obj['result'][0]['Ask'] . '
'
;
?>

My question, the code show
Bittrex Ƀ 4.74E-6 and I want something like this Bittrex Ƀ 0.00000474
legendary
Activity: 1148
Merit: 1000
March 15, 2016, 04:11:55 AM
#5
Where is a good start to make price scripts from exchanges for my website?

do you want to add like a price indicator to your website or option to buy and sell through exchanger's API

i am not an expert but for the first you can add a price widget to your site like this:
Code:


Quote
I want to understand API exchange

API exchange is basically sending an http request to the exchanger with what you want to do and signing it with your API secret key for security.
and example:
{APIRequestURI}/createorder&MarketName=BTC_USD&Amount=1&type=sell&price=420

then sign this with API secret and send it via POST method and receive the JSON response.

Thx for that, but I want host the script on my website not from other websites
legendary
Activity: 1148
Merit: 1000
March 15, 2016, 04:09:32 AM
#4
I can probably write a couple price widgets for you, so you can use them directly onto your site, and learn from the samples?
PM me for a quote if you're interested!

I have send you a PM
legendary
Activity: 3514
Merit: 5123
https://merel.mobi => buy facemasks with BTC/LTC
March 15, 2016, 03:48:59 AM
#3
I can probably write a couple price widgets for you, so you can use them directly onto your site, and learn from the samples?
PM me for a quote if you're interested!
legendary
Activity: 3472
Merit: 10611
March 15, 2016, 03:40:28 AM
#2
Where is a good start to make price scripts from exchanges for my website?

do you want to add like a price indicator to your website or option to buy and sell through exchanger's API

i am not an expert but for the first you can add a price widget to your site like this:
Code:


Quote
I want to understand API exchange

API exchange is basically sending an http request to the exchanger with what you want to do and signing it with your API secret key for security.
and example:
{APIRequestURI}/createorder&MarketName=BTC_USD&Amount=1&type=sell&price=420

then sign this with API secret and send it via POST method and receive the JSON response.
legendary
Activity: 1148
Merit: 1000
March 14, 2016, 10:33:04 AM
#1
Where is a good start to make price scripts from exchanges for my website?

I want to understand API exchange
Jump to: