# 区块链开发入门02 使用币安API获取代币价格

By [n37r09u3](https://paragraph.com/@n37r09u3) · 2022-05-27

---

[![]({{DOMAIN}}/editor/youtube/play.png)](https://www.youtube.com/watch?v=NMcCM79mFqg)

[https://github.com/binance/binance-connector-node](https://github.com/binance/binance-connector-node)

    const { Spot } = require('@binance/connector')
    
    const client = new Spot()
    
    client.tickerPrice('SHIBUSDT').then(response => console.log(response.data))
    

### 更新

由于现货价格接口不需要认证 所以可以省略key和secret

### 代理问题

推荐在外国主机上运行代码

本地要走sock5代理 应该要改造一下connector里的axios实例化代码

![https://github.com/binance/binance-connector-node/blob/54368ccfde50055cf02ae9dae883d61ff5e560a3/src/helpers/utils.js#L38](https://storage.googleapis.com/papyrus_images/26b8561ccefdd5b8c554523ce308e61c44f09b65e3aaa37bced7e105073f2266.png)

https://github.com/binance/binance-connector-node/blob/54368ccfde50055cf02ae9dae883d61ff5e560a3/src/helpers/utils.js#L38

具体参考 [这里](https://medium.com/@paynoattn/using-a-socks-proxy-to-make-requests-in-node-js-ba5125c7999f)

---

*Originally published on [n37r09u3](https://paragraph.com/@n37r09u3/02-api)*
