API/zaif/取引通貨一覧の取得(PHP)
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* zaif取り扱い仮想通貨ペア一覧の取得サンプルコード(PHP) [...
&color(red){当サイトに記載されている会社名、製品名などは...
----
PHPを使って&htmlinsert(zaif.html);が取り扱っている仮想通...
詳細な情報を取得する場合は、以下の記事を参照ください。~
-[[currency_pairs・通貨ペア情報を取得(PHP)>API/zaif/curre...
#contents
----
以下のバナーは&htmlinsert(zaif.html);へのリンクです。~
#htmlinsert(zaif_wide_1.html)
* 関連記事 [#s807f4c1]
-[[API動作環境構築>API/環境構築]]
-[[currencies・通貨情報の取得(PHP)>API/zaif/currencies(PH...
-[[currency_pairs・通貨ペア情報を取得(PHP)>API/zaif/curre...
-[[last_price・現在の終値を取得(PHP)>API/zaif/last_price(...
-[[ticker・ティッカーを取得(PHP)>API/zaif/ticker(PHP)]]
-[[depth・板情報を取得(PHP)>API/zaif/depth(PHP)]]
-[[trades・全ての取引履歴を取得(PHP)>API/zaif/trades(PHP)]]
-[[取引通貨一覧の取得(PHP)>API/zaif/取引通貨一覧の取得(PH...
-[[ZaifのAPIキー生成手順>API/zaif/APIキー生成手順]]
-[[アカウントの残高確認(PHP)>API/zaif/残高確認・get_info,...
* トレードAPIで必要なcurrency_pair一覧を取得する [#icdc0b...
本PHPサンプルコードは、以下の記事で紹介したサンプルコード...
-[[currency_pairs・通貨ペア情報を取得(PHP)>API/zaif/curre...
トレードAPIにて売買通貨を指定する場合、currency_pairが必...
** サンプルコード [#y8bdfbe1]
以下のサンプルコードを実行すると、&htmlinsert(zaif.html)...
#ref(zaif_cur_pairs.php.zip)
<?php
// API doc : http://techbureau-api-document.readthedocs....
// API url : https://api.zaif.jp/api/1/currency_pairs/{c...
// currency_pair api url
$zaif_api_url = "https://api.zaif.jp/api/1/currency_pai...
// proxy settings
$proxy = "";
$proxy_port = "";
$curl = curl_init();
if ($curl == FALSE) {
fputs(STDERR, "[ERR] curl_init(): " . curl_error($cu...
die(1);
}
// curl set options
$currency = "all"; // all currency_pair
curl_setopt($curl, CURLOPT_URL, $zaif_api_url . $currenc...
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
// set proxy server settings
if (!empty($proxy) && !empty($proxy_port)) {
curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($curl, CURLOPT_PROXY, $proxy . ":" . $pr...
curl_setopt($curl, CURLOPT_PROXYPORT, $proxy_port);
}
// call currency_pair api
$response = curl_exec($curl);
if ($response == FALSE) {
fputs(STDERR, "[ERR] curl_exec(): " . curl_error($cu...
die(1);
}
// json decode
$json_decode = json_decode($response, true);
if ($json_decode == NULL) {
fputs(STDERR, "[ERR] json_decode(): " . json_last_er...
die(1);
}
curl_close($curl);
// show currency_pairs
//print_r($json_decode);
// sort by id
foreach ($json_decode as $key => $value){
$key_id[$key] = $value['id'];
}
array_multisort ($key_id , SORT_ASC , $json_decode);
// show currency_pairs
foreach ($json_decode as $cur_pair) {
printf($cur_pair["currency_pair"] . PHP_EOL);
}
exit(0);
** 実行結果 [#k867dbea]
以下に上記のサンプルコードを実行したときの出力を記します。
$ php zaif_cur_pairs.php
btc_jpy
mona_jpy
mona_btc
xem_jpy
xem_btc
zaif_jpy
zaif_btc
xcp_jpy
xcp_btc
bitcrystals_jpy
bitcrystals_btc
sjcx_jpy
sjcx_btc
fscc_jpy
fscc_btc
pepecash_jpy
pepecash_btc
cicc_jpy
cicc_btc
ncxc_jpy
ncxc_btc
jpyz_jpy
bch_jpy
bch_btc
eth_jpy
eth_btc
erc20.cms_jpy
mosaic.cms_jpy
この記事を書いている日にCOMSAが上場されました。~
COMSAも通貨ペア(currency_pair)に追加されているのが確認で...
$ php zaif_cur_pairs.php | grep cms
erc20.cms_jpy
mosaic.cms_jpy
以上、&htmlinsert(zaif.html);の公開APIである通貨ペア情報...
----
以下のバナーは&htmlinsert(zaif.html);へのリンクです。~
#htmlinsert(zaif_wide_3.html)
終了行:
#navi(../)
* zaif取り扱い仮想通貨ペア一覧の取得サンプルコード(PHP) [...
&color(red){当サイトに記載されている会社名、製品名などは...
----
PHPを使って&htmlinsert(zaif.html);が取り扱っている仮想通...
詳細な情報を取得する場合は、以下の記事を参照ください。~
-[[currency_pairs・通貨ペア情報を取得(PHP)>API/zaif/curre...
#contents
----
以下のバナーは&htmlinsert(zaif.html);へのリンクです。~
#htmlinsert(zaif_wide_1.html)
* 関連記事 [#s807f4c1]
-[[API動作環境構築>API/環境構築]]
-[[currencies・通貨情報の取得(PHP)>API/zaif/currencies(PH...
-[[currency_pairs・通貨ペア情報を取得(PHP)>API/zaif/curre...
-[[last_price・現在の終値を取得(PHP)>API/zaif/last_price(...
-[[ticker・ティッカーを取得(PHP)>API/zaif/ticker(PHP)]]
-[[depth・板情報を取得(PHP)>API/zaif/depth(PHP)]]
-[[trades・全ての取引履歴を取得(PHP)>API/zaif/trades(PHP)]]
-[[取引通貨一覧の取得(PHP)>API/zaif/取引通貨一覧の取得(PH...
-[[ZaifのAPIキー生成手順>API/zaif/APIキー生成手順]]
-[[アカウントの残高確認(PHP)>API/zaif/残高確認・get_info,...
* トレードAPIで必要なcurrency_pair一覧を取得する [#icdc0b...
本PHPサンプルコードは、以下の記事で紹介したサンプルコード...
-[[currency_pairs・通貨ペア情報を取得(PHP)>API/zaif/curre...
トレードAPIにて売買通貨を指定する場合、currency_pairが必...
** サンプルコード [#y8bdfbe1]
以下のサンプルコードを実行すると、&htmlinsert(zaif.html)...
#ref(zaif_cur_pairs.php.zip)
<?php
// API doc : http://techbureau-api-document.readthedocs....
// API url : https://api.zaif.jp/api/1/currency_pairs/{c...
// currency_pair api url
$zaif_api_url = "https://api.zaif.jp/api/1/currency_pai...
// proxy settings
$proxy = "";
$proxy_port = "";
$curl = curl_init();
if ($curl == FALSE) {
fputs(STDERR, "[ERR] curl_init(): " . curl_error($cu...
die(1);
}
// curl set options
$currency = "all"; // all currency_pair
curl_setopt($curl, CURLOPT_URL, $zaif_api_url . $currenc...
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
// set proxy server settings
if (!empty($proxy) && !empty($proxy_port)) {
curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($curl, CURLOPT_PROXY, $proxy . ":" . $pr...
curl_setopt($curl, CURLOPT_PROXYPORT, $proxy_port);
}
// call currency_pair api
$response = curl_exec($curl);
if ($response == FALSE) {
fputs(STDERR, "[ERR] curl_exec(): " . curl_error($cu...
die(1);
}
// json decode
$json_decode = json_decode($response, true);
if ($json_decode == NULL) {
fputs(STDERR, "[ERR] json_decode(): " . json_last_er...
die(1);
}
curl_close($curl);
// show currency_pairs
//print_r($json_decode);
// sort by id
foreach ($json_decode as $key => $value){
$key_id[$key] = $value['id'];
}
array_multisort ($key_id , SORT_ASC , $json_decode);
// show currency_pairs
foreach ($json_decode as $cur_pair) {
printf($cur_pair["currency_pair"] . PHP_EOL);
}
exit(0);
** 実行結果 [#k867dbea]
以下に上記のサンプルコードを実行したときの出力を記します。
$ php zaif_cur_pairs.php
btc_jpy
mona_jpy
mona_btc
xem_jpy
xem_btc
zaif_jpy
zaif_btc
xcp_jpy
xcp_btc
bitcrystals_jpy
bitcrystals_btc
sjcx_jpy
sjcx_btc
fscc_jpy
fscc_btc
pepecash_jpy
pepecash_btc
cicc_jpy
cicc_btc
ncxc_jpy
ncxc_btc
jpyz_jpy
bch_jpy
bch_btc
eth_jpy
eth_btc
erc20.cms_jpy
mosaic.cms_jpy
この記事を書いている日にCOMSAが上場されました。~
COMSAも通貨ペア(currency_pair)に追加されているのが確認で...
$ php zaif_cur_pairs.php | grep cms
erc20.cms_jpy
mosaic.cms_jpy
以上、&htmlinsert(zaif.html);の公開APIである通貨ペア情報...
----
以下のバナーは&htmlinsert(zaif.html);へのリンクです。~
#htmlinsert(zaif_wide_3.html)
ページ名: