Longbridge Developers
立即开始

美股加密货币概览

Longbridge US 账户

此方法仅适用于美国数据中心账户。

获取美股加密货币交易对的概览信息——历史最高/最低价、资产详情和货币信息。

>_ CLI
# 美股加密货币概览
longbridge static DOGEUSD.BKKT

Parameters

SDK 方法参数。

名称类型必填描述
symbolstring是加密货币交易对,例如 DOGEUSD.BKKT

Request Example

from longbridge.openapi import QuoteContext, Config, OAuthBuilder

oauth = OAuthBuilder("your-client-id").build(lambda url: print("请访问:", url))
config = Config.from_oauth(oauth)
ctx = QuoteContext(config)
resp = ctx.us_crypto_overview("DOGEUSD.BKKT")
print(resp)
import asyncio
from longbridge.openapi import AsyncQuoteContext, Config, OAuthBuilder

async def main() -> None:
    oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("请访问:", url))
    config = Config.from_oauth(oauth)
    ctx = AsyncQuoteContext.create(config)
    resp = await ctx.us_crypto_overview("DOGEUSD.BKKT")
    print(resp)

if __name__ == "__main__":
    asyncio.run(main())
const { Config, QuoteContext, OAuth } = require('longbridge')

async function main() {
  const oauth = await OAuth.build('your-client-id', (_, url) => {
    console.log('请访问此 URL 授权:' + url)
  })
  const config = Config.fromOAuth(oauth)
  const ctx = QuoteContext.new(config)
  const resp = await ctx.usCryptoOverview("DOGEUSD.BKKT")
  console.log(resp)
}
main().catch(console.error)
import com.longbridge.*;
import com.longbridge.quote.*;

class Main {
    public static void main(String[] args) throws Exception {
        try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get();
             Config config = Config.fromOAuth(oauth);
             QuoteContext ctx = QuoteContext.create(config)) {
            var resp = ctx.getUsCryptoOverview("DOGEUSD.BKKT").get();
            System.out.println(resp);
        }
    }
}
use std::sync::Arc;
use longbridge::{oauth::OAuthBuilder, quote::QuoteContext, Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("请访问:{url}")).await?;
    let config = Arc::new(Config::from_oauth(oauth));
    let ctx = QuoteContext::new(config);
    let resp = ctx.us_crypto_overview("DOGEUSD.BKKT").await?;
    println!("{:?}", resp);
    Ok(())
}
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/longbridge/openapi-go/config"
	"github.com/longbridge/openapi-go/oauth"
	"github.com/longbridge/openapi-go/quote"
)

func main() {
	o := oauth.New("your-client-id").
		OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) })
	if err := o.Build(context.Background()); err != nil {
		log.Fatal(err)
	}
	conf, err := config.New(config.WithOAuthClient(o))
	if err != nil {
		log.Fatal(err)
	}
	c, err := quote.NewFromCfg(conf)
	if err != nil {
		log.Fatal(err)
	}
	defer c.Close()
	resp, err := c.CryptoOverview(context.Background(), "DOGEUSD.BKKT")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", resp)
}

响应字段

字段类型描述
symbolstring交易对代码
namestring资产名称
tickerstring简短代码
base_assetstring基础资产代码
currencystring计价货币
all_time_highstring历史最高价
all_time_high_datestring历史最高价日期
all_time_lowstring历史最低价
all_time_low_datestring历史最低价日期

Response

Response Example

{
  "symbol": "DOGEUSD.BKKT",
  "name": "Dogecoin",
  "ticker": "DOGE",
  "base_asset": "DOGE",
  "currency": "USD",
  "all_time_high": "0.7376",
  "all_time_high_date": "2021-05-08",
  "all_time_low": "0.0000869",
  "all_time_low_date": "2015-05-06",
  "ipo_date": "2013-12-06",
  "shares": "147000000000",
  "official_web_address": "https://dogecoin.com"
}

Response Status

状态码描述结构
200成功CryptoOverview
400请求错误None

Schemas

CryptoOverview

名称类型必填描述
symbolstring是交易对代码,如 DOGEUSD.BKKT
namestring是资产名称
tickerstring是简短代码
base_assetstring是基础资产代码,如 DOGE
currencystring是计价货币,如 USD
all_time_highstring是历史最高价
all_time_high_datestring是历史最高价日期
all_time_lowstring是历史最低价
all_time_low_datestring是历史最低价日期
ipo_datestring否初始上市日期
issue_pricestring否初始发行价格
sharesstring否流通总量
official_web_addressstring否官方网站 URL
logostring否资产 Logo URL
wiki_urlstring否Wikipedia URL
profilestring否资产简介(JSON 字符串)