API/Bitfinex/ファンディング情報を取得する(API v1)(PowerShell)
の編集
Top
/
API
/
Bitfinex
/
ファンディング情報を取得する(API v1)(PowerShell)
[
トップ
] [
編集
|
差分
|
バックアップ
|
添付
|
リロード
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
-- 雛形とするページ --
API
API/Bitfinex
API/Bitfinex/Tickerの取得(API v1)(PowerShell)
API/Bitfinex/ファンディング情報を取得する(API v1)(PowerShell)
API/Bitfinex/取引情報を取得する(API v1)(PowerShell)
API/Bitfinex/指定した通貨ペアの取引量を取得する(API v1)(PowerShell)
API/Bitfinex/板情報(注文一覧)を取得する(API v1)(PowerShell)
API/Bitfinex/通貨ペアのシンボル一覧の取得(API v1)(PowerShell)
API/bitFlyer
API/bitFlyer/Tickerの取得(PowerShell)
API/bitFlyer/マーケットの一覧の取得(PowerShell)
API/bitFlyer/板情報の取得(PowerShell)
API/coincheck
API/coincheck/APIキー生成手順
API/coincheck/ティッカー(PHP)
API/coincheck/ティッカー(PowerShell)
API/coincheck/ポジション一覧(PHP)
API/coincheck/レバレッジアカウントの残高取得
API/coincheck/レバレッジ取引注文(PHP)
API/coincheck/レート取得(PHP)
API/coincheck/全取引履歴(PHP)
API/coincheck/新規注文・現物売買(PHP)
API/coincheck/最近の取引履歴の取得(PHP)
API/coincheck/板情報(PHP)
API/coincheck/板情報の取得(PowerShell)
API/coincheck/残高確認(PHP)
API/coincheck/販売レート取得(PHP)
API/CoinExchange.io
API/CoinExchange.io/MarketID一覧を取得する・getmarkets(PowerShell)
API/CoinExchange.io/マーケットサマリ情報取得・getmarketsummaries(PowerShell)
API/CoinExchange.io/マーケット一覧情報取得・getmarkets(PowerShell)
API/CoinExchange.io/仮想通貨一覧を取得・getcurrencies(PowerShell)
API/CoinExchange.io/指定した通貨の通貨情報を取得する・getcurrency(PowerShell)
API/CoinExchange.io/指定した通貨ペアのマーケットサマリ情報を取得・getmarketsummary(PowerShell)
API/CoinExchange.io/指定した通貨ペアの売買注文一覧の取得・getorderbook(PowerShell)
API/GMOコイン
API/GMOコイン/銘柄の最新レートを取得(Bash)
API/GMOコイン/銘柄の最新レートを取得(PowerShell)
API/NEM(XEM)
API/NEM(XEM)/スーパーノード一覧を取得するサンプルコード(PHP)
API/NEM(XEM)/ハーベストの有効・無効状態を取得するサンプルコード(PHP)
API/zaif
API/zaif/APIキー生成手順
API/zaif/currencies(PHP)
API/zaif/currency_pairs(PHP)
API/zaif/currency_pairs・通貨ペア情報を取得する方法(PowerShell)
API/zaif/depth(PHP)
API/zaif/last_price(PHP)
API/zaif/ticker(PHP)
API/zaif/trades(PHP)
API/zaif/取引通貨一覧の取得(PHP)
API/zaif/新規注文・現物売買・trade(PHP)
API/zaif/残高確認・get_info, get_info2(PHP)
API/環境構築
AutoTicketLinkName
BracketName
FrontPage
ICO/COMSA
InterWiki
MenuBar
RecentDeleted
お約束
ウォレット
ウォレット/BRD,CoinbaseウォレットをElectrumウォレットに移行する手順
ウォレット/Bread walletをElectrumに移行する
ウォレット/Debian用に公開されたYenten-QTを動かしてみた
ウォレット/KotoウォレットをDebian, Ubuntu系にインストール
ウォレット/Nano Wallet
ウォレット/SHIELD-QT v3ウォレットで残高がおかしい場合の対処方法
プライバシーポリシー
マイニング
マイニング/CentOSでBitZenyをマイニング
マイニング/CentOSでYentenをマイニングする
マイニング/cpuminerとUbuntuでモナーコインを採掘してみる
マイニング/GUIでマイニング・MinerGate
マイニング/UbuntuでBitZenyをマイニング
マイニング/UbuntuとGPU(NVIDIA)でMonaコインをマイニングしてみる
マイニング/Windows64bitマシンでモナーコインを採掘してみる
マイニング/WindowsでZcashをマイニング
仮想通貨サイト
仮想通貨取引所
仮想通貨取引所/2段階認証のバックアップ
仮想通貨取引所/Poloniex登録方法
最初にお読みください
用語集
#navi(../) * Bitfinexのファンディング情報を取得する(API v1)(PowerShell) [#r2565278] PowerShellでBitfinexのファンディング情報(lendbook)を取得する操作例を以下に記します。~ Bitfinexでは、レンディングではなくファンディングと呼んでいるようですね。~ Fundingbook APIのページを見ると ''lend''bookとなっていますが… #contents #htmlinsert(cc-top.html) * 参考資料 [#v30735ca] Bitfinexのファンディング情報(lendbook)を取得するAPIドキュメントURL~ Fundingbook API仕様は、以下のURLで確認してください。~ https://bitfinex.readme.io/v1/reference#rest-public-fundingbook * 関連記事 [#db3f03b2] -[[Bitfinexの通貨シンボル一覧の取得(API v1)(PowerShell)>API/Bitfinex/通貨ペアのシンボル一覧の取得(API v1)(PowerShell)]] -[[BitfinexのTickerの取得(API v1)(PowerShell)>API/Bitfinex/Tickerの取得(API v1)(PowerShell)]] -[[Bitfinexで指定した通貨ペアの取引量を取得する(API v1)(PowerShell)>API/Bitfinex/指定した通貨ペアの取引量を取得する(API v1)(PowerShell)]] -[[Bitfinexのファンディング情報を取得する(API v1)(PowerShell)>API/Bitfinex/ファンディング情報を取得する(API v1)(PowerShell)]] -[[Bitfinexの板情報(注文一覧)を取得する(API v1)(PowerShell)>API/Bitfinex/板情報(注文一覧)を取得する(API v1)(PowerShell)]] * ブラウザでアクセスしてみる [#da3f2cc7] 以下、URLでBTCのファンディング(レンディング)情報が取得できます。~ https://api.bitfinex.com/v1/lendbook/BTC |''JSON''| |&ref(01.png);| |''生データ''| |&ref(02.png);| * PowerShellによるアクセス [#se9db58e] PowerShellの''Invoke-RestMethod''コマンドレットと、''Invoke-WebRequest''+''ConvertFrom-Json''コマンドレットを使って、~ 指定した通貨のファンディング(レンディング)情報を取得してみます。 ** ''Invoke-RestMethod''コマンドレット [#ae9027e0] ''Invoke-RestMethod''コマンドレットを使用して、指定した通貨のファンディング(レンディング)情報を取得する操作例になります。~ PS C:\> $v1_lendbook_api = "https://api.bitfinex.com/v1/lendbook/" PS C:\> $currency = "BTC" PS C:\> $lendbook = Invoke-RestMethod -UseBasicParsing ($v1_lendbook_api + $currency) PS C:\> $lendbook bids ---- {@{rate=5.548; amount=85.02918116; period=30; timestamp=1530817703.0; frr=No}, @{rate=5.548; amount=101.74978106; pe... bits, asksの情報はデフォルトでは、最大50件となっていたので、取得件数を確認してみます。 PS C:\> $lendbook.bids.Count 50 PS C:\> $lendbook.asks.Count 50 パラメータとして、limit_bids, limit_asks があります。~ これは、bids, asks の最大取得件数を指定するパラメータになります。~ bids, asksともに2件と指定し、取得してみます。 PS C:\> $currency = "ETH" PS C:\> $limit_bids = 2 PS C:\> $limit_asks = 2 PS C:\> $lendbook = Invoke-RestMethod -UseBasicParsing ($v1_lendbook_api + $currency + "?limit_bids=${limit_bids}&limit_asks=${limit_asks}") PS C:\> $lendbook bids asks ---- ---- {@{rate=3.285; amount=677.4577947; period=30; timestamp=1531314687.0; frr=No}, @{rate=2.993; amount=1840.63028393; period=30; timestamp=1530807405.0; frr=No}} {@{rate=1.8826; amount=0.6076321; perio d=2; time... PS C:\> $lendbook.bids.Count 2 PS C:\> $lendbook.asks.Count 2 PS C:\> $lendbook.bids rate : 3.285 amount : 677.4577947 period : 30 timestamp : 1531314687.0 frr : No rate : 2.993 amount : 1840.63028393 period : 30 timestamp : 1530807405.0 frr : No PS C:\> $lendbook.asks rate : 1.8826 amount : 0.6076321 period : 2 timestamp : 1531409769.0 frr : No rate : 1.8826 amount : 0.420347 period : 2 timestamp : 1531409848.0 frr : No bids, asksともに指定した件数が取得されているのが確認できます。~ 上記の例では、currencyにBTCとETHを指定しました。 ** ''Invoke-WebRequest''+''ConvertFrom-Json''コマンドレット [#f0fdcf21] ''Invoke-WebRequest''使うことにより、HTTPステータスや、Content-Typeなどを取得することができます。~ 取得したContent部分を''ConvertFrom-Json''コマンドレットを使うことにより、Invoke-RestMethodと同様に、~ JSON形式でアクセスすることができます。 + Invoke-WebRequestでFundingbook APIをアクセス PS C:\> $v1_lendbook_api = "https://api.bitfinex.com/v1/lendbook/" PS C:\> $currency = "XRP" PS C:\> $limit_bids = 1 PS C:\> $limit_asks = 1 PS C:\> $response = Invoke-WebRequest -UseBasicParsing ($v1_lendbook_api + $currency + "?limit_bids=${limit_bids}&limit_asks=${limit_asks}") + 取得したレスポンスを表示します。 PS C:\> $response StatusCode : 200 StatusDescription : OK Content : {"bids":[{"rate":"0.0219","amount":"12183.20629104","period":30,"timestamp":"1531288055.0","frr":"No"}],"asks":[{"rate":"0.0107","amount":"27999.95578344","period":2,"timestamp":"1531340089. 0","frr":"... RawContent : HTTP/1.1 200 OK Connection: keep-alive X-Frame-Options: SAMEORIGIN,SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff X-Request-Id: a13c409a-6ba4-4134-92fc-831a67d49c55 X... Forms : Headers : {[Connection, keep-alive], [X-Frame-Options, SAMEORIGIN,SAMEORIGIN], [X-XSS-Protection, 1; mode=block], [X-Content-Type-Options, nosniff]...} Images : {} InputFields : {} Links : {} ParsedHtml : RawContentLength : 206 +HTTPステータスコード、ヘッダー、Content-Typeなどにアクセスしてみます。 PS C:\> $response.StatusCode 200 PS C:\> $response.Headers Key Value --- ----- Connection keep-alive X-Frame-Options SAMEORIGIN,SAMEORIGIN X-XSS-Protection 1; mode=block X-Content-Type-Options nosniff X-Request-Id a13c409a-6ba4-4134-92fc-831a67d49c55 X-Runtime 0.111515 Strict-Transport-Security max-age=31536000 Expect-CT max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" CF-RAY 4394ac61ce696ef9-NRT Content-Length 206 Cache-Control max-age=0, private, must-revalidate Content-Type application/json; charset=utf-8 Date Thu, 12 Jul 2018 15:51:49 GMT ETag W/"2307dfec05c81f6dec04bca6736668d9" Set-Cookie __cfduid=d8e96e5fad527ff5c6808a2c4275200b51531410708; expires=Fri, 12-Jul-19 15:51:48 GMT; path=/; domain=.bitfinex.com; HttpOnly Server cloudflare PS C:\> $response.Headers.'Content-Type' application/json; charset=utf-8 +ConvertFrom-Jsonコマンドレットを使うことにより、JSON形式に変換することができます。 PS C:\> $json = ConvertFrom-Json $response.Content PS C:\> $json bids asks ---- ---- {@{rate=0.0219; amount=12183.20629104; period=30; timestamp=1531288055.0; frr=No}} {@{rate=0.0107; amount=27999.95578344; period=2; timestamp=1531340089.0; frr=No}} * Webの応答を読み取っています。(Waiting for response)を非表示にする方法 [#oa4afca0] 上記のコマンドレットを実行すると、APIサーバとのやり取りのプログレスメッセージが表示されます。~ #ref(51.png) これを非表示にしたい場合は、以下のようにしてください。 非表示にするには、$ProgressPreferenceにSilentlyContinueを設定します。~ 変更前は以下のように Continue が設定されています。 PS C:\> $ProgressPreference Continue 非表示にするには、以下のように変更します。 PS C:\> $ProgressPreference = "SilentlyContinue" 以上、PowerShellを使って、BitfinexのFundingbook APIを呼び出す方法でした。 #htmlinsert(cc-btm.html)
タイムスタンプを変更しない
#navi(../) * Bitfinexのファンディング情報を取得する(API v1)(PowerShell) [#r2565278] PowerShellでBitfinexのファンディング情報(lendbook)を取得する操作例を以下に記します。~ Bitfinexでは、レンディングではなくファンディングと呼んでいるようですね。~ Fundingbook APIのページを見ると ''lend''bookとなっていますが… #contents #htmlinsert(cc-top.html) * 参考資料 [#v30735ca] Bitfinexのファンディング情報(lendbook)を取得するAPIドキュメントURL~ Fundingbook API仕様は、以下のURLで確認してください。~ https://bitfinex.readme.io/v1/reference#rest-public-fundingbook * 関連記事 [#db3f03b2] -[[Bitfinexの通貨シンボル一覧の取得(API v1)(PowerShell)>API/Bitfinex/通貨ペアのシンボル一覧の取得(API v1)(PowerShell)]] -[[BitfinexのTickerの取得(API v1)(PowerShell)>API/Bitfinex/Tickerの取得(API v1)(PowerShell)]] -[[Bitfinexで指定した通貨ペアの取引量を取得する(API v1)(PowerShell)>API/Bitfinex/指定した通貨ペアの取引量を取得する(API v1)(PowerShell)]] -[[Bitfinexのファンディング情報を取得する(API v1)(PowerShell)>API/Bitfinex/ファンディング情報を取得する(API v1)(PowerShell)]] -[[Bitfinexの板情報(注文一覧)を取得する(API v1)(PowerShell)>API/Bitfinex/板情報(注文一覧)を取得する(API v1)(PowerShell)]] * ブラウザでアクセスしてみる [#da3f2cc7] 以下、URLでBTCのファンディング(レンディング)情報が取得できます。~ https://api.bitfinex.com/v1/lendbook/BTC |''JSON''| |&ref(01.png);| |''生データ''| |&ref(02.png);| * PowerShellによるアクセス [#se9db58e] PowerShellの''Invoke-RestMethod''コマンドレットと、''Invoke-WebRequest''+''ConvertFrom-Json''コマンドレットを使って、~ 指定した通貨のファンディング(レンディング)情報を取得してみます。 ** ''Invoke-RestMethod''コマンドレット [#ae9027e0] ''Invoke-RestMethod''コマンドレットを使用して、指定した通貨のファンディング(レンディング)情報を取得する操作例になります。~ PS C:\> $v1_lendbook_api = "https://api.bitfinex.com/v1/lendbook/" PS C:\> $currency = "BTC" PS C:\> $lendbook = Invoke-RestMethod -UseBasicParsing ($v1_lendbook_api + $currency) PS C:\> $lendbook bids ---- {@{rate=5.548; amount=85.02918116; period=30; timestamp=1530817703.0; frr=No}, @{rate=5.548; amount=101.74978106; pe... bits, asksの情報はデフォルトでは、最大50件となっていたので、取得件数を確認してみます。 PS C:\> $lendbook.bids.Count 50 PS C:\> $lendbook.asks.Count 50 パラメータとして、limit_bids, limit_asks があります。~ これは、bids, asks の最大取得件数を指定するパラメータになります。~ bids, asksともに2件と指定し、取得してみます。 PS C:\> $currency = "ETH" PS C:\> $limit_bids = 2 PS C:\> $limit_asks = 2 PS C:\> $lendbook = Invoke-RestMethod -UseBasicParsing ($v1_lendbook_api + $currency + "?limit_bids=${limit_bids}&limit_asks=${limit_asks}") PS C:\> $lendbook bids asks ---- ---- {@{rate=3.285; amount=677.4577947; period=30; timestamp=1531314687.0; frr=No}, @{rate=2.993; amount=1840.63028393; period=30; timestamp=1530807405.0; frr=No}} {@{rate=1.8826; amount=0.6076321; perio d=2; time... PS C:\> $lendbook.bids.Count 2 PS C:\> $lendbook.asks.Count 2 PS C:\> $lendbook.bids rate : 3.285 amount : 677.4577947 period : 30 timestamp : 1531314687.0 frr : No rate : 2.993 amount : 1840.63028393 period : 30 timestamp : 1530807405.0 frr : No PS C:\> $lendbook.asks rate : 1.8826 amount : 0.6076321 period : 2 timestamp : 1531409769.0 frr : No rate : 1.8826 amount : 0.420347 period : 2 timestamp : 1531409848.0 frr : No bids, asksともに指定した件数が取得されているのが確認できます。~ 上記の例では、currencyにBTCとETHを指定しました。 ** ''Invoke-WebRequest''+''ConvertFrom-Json''コマンドレット [#f0fdcf21] ''Invoke-WebRequest''使うことにより、HTTPステータスや、Content-Typeなどを取得することができます。~ 取得したContent部分を''ConvertFrom-Json''コマンドレットを使うことにより、Invoke-RestMethodと同様に、~ JSON形式でアクセスすることができます。 + Invoke-WebRequestでFundingbook APIをアクセス PS C:\> $v1_lendbook_api = "https://api.bitfinex.com/v1/lendbook/" PS C:\> $currency = "XRP" PS C:\> $limit_bids = 1 PS C:\> $limit_asks = 1 PS C:\> $response = Invoke-WebRequest -UseBasicParsing ($v1_lendbook_api + $currency + "?limit_bids=${limit_bids}&limit_asks=${limit_asks}") + 取得したレスポンスを表示します。 PS C:\> $response StatusCode : 200 StatusDescription : OK Content : {"bids":[{"rate":"0.0219","amount":"12183.20629104","period":30,"timestamp":"1531288055.0","frr":"No"}],"asks":[{"rate":"0.0107","amount":"27999.95578344","period":2,"timestamp":"1531340089. 0","frr":"... RawContent : HTTP/1.1 200 OK Connection: keep-alive X-Frame-Options: SAMEORIGIN,SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff X-Request-Id: a13c409a-6ba4-4134-92fc-831a67d49c55 X... Forms : Headers : {[Connection, keep-alive], [X-Frame-Options, SAMEORIGIN,SAMEORIGIN], [X-XSS-Protection, 1; mode=block], [X-Content-Type-Options, nosniff]...} Images : {} InputFields : {} Links : {} ParsedHtml : RawContentLength : 206 +HTTPステータスコード、ヘッダー、Content-Typeなどにアクセスしてみます。 PS C:\> $response.StatusCode 200 PS C:\> $response.Headers Key Value --- ----- Connection keep-alive X-Frame-Options SAMEORIGIN,SAMEORIGIN X-XSS-Protection 1; mode=block X-Content-Type-Options nosniff X-Request-Id a13c409a-6ba4-4134-92fc-831a67d49c55 X-Runtime 0.111515 Strict-Transport-Security max-age=31536000 Expect-CT max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" CF-RAY 4394ac61ce696ef9-NRT Content-Length 206 Cache-Control max-age=0, private, must-revalidate Content-Type application/json; charset=utf-8 Date Thu, 12 Jul 2018 15:51:49 GMT ETag W/"2307dfec05c81f6dec04bca6736668d9" Set-Cookie __cfduid=d8e96e5fad527ff5c6808a2c4275200b51531410708; expires=Fri, 12-Jul-19 15:51:48 GMT; path=/; domain=.bitfinex.com; HttpOnly Server cloudflare PS C:\> $response.Headers.'Content-Type' application/json; charset=utf-8 +ConvertFrom-Jsonコマンドレットを使うことにより、JSON形式に変換することができます。 PS C:\> $json = ConvertFrom-Json $response.Content PS C:\> $json bids asks ---- ---- {@{rate=0.0219; amount=12183.20629104; period=30; timestamp=1531288055.0; frr=No}} {@{rate=0.0107; amount=27999.95578344; period=2; timestamp=1531340089.0; frr=No}} * Webの応答を読み取っています。(Waiting for response)を非表示にする方法 [#oa4afca0] 上記のコマンドレットを実行すると、APIサーバとのやり取りのプログレスメッセージが表示されます。~ #ref(51.png) これを非表示にしたい場合は、以下のようにしてください。 非表示にするには、$ProgressPreferenceにSilentlyContinueを設定します。~ 変更前は以下のように Continue が設定されています。 PS C:\> $ProgressPreference Continue 非表示にするには、以下のように変更します。 PS C:\> $ProgressPreference = "SilentlyContinue" 以上、PowerShellを使って、BitfinexのFundingbook APIを呼び出す方法でした。 #htmlinsert(cc-btm.html)
テキスト整形のルールを表示する
添付ファイル:
02.png
458件
[
詳細
]
01.png
494件
[
詳細
]
51.png
478件
[
詳細
]