# Fetsh JSON

**URL:** <https://community.glideapps.com/t/fetsh-json/50891>\
**Category:** Ask for Help\
**Created:** [October 4, 2022, 11:54pm UTC](https://community.glideapps.com/t/fetsh-json/50891 "2022-10-04T23:54:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladilkud](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vladilkud/32/42496_2.png) [@vladilkud](https://community.glideapps.com/u/vladilkud)\
**Post date:** [October 4, 2022, 11:54pm UTC](https://community.glideapps.com/t/fetsh-json/50891/1 "2022-10-04T23:54:49Z")

</div>

Hi all.

There is a request through the Fetch JSON column to the Binance and ByBit crypto exchanges. Each has its own response in JSON format.

I apply the “.price” filter to the response from Binance and everything works, the price is displayed.  
Request: [https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT](https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT)  
Response: {“symbol”:“BTCUSDT”,“price”:“20343.35000000”}

Next I also do for ByBit:  
Request: [https://api.bybit.com/spot/v3/public/quote/ticker/price?symbol=BTCUSDT](https://api.bybit.com/spot/v3/public/quote/ticker/price?symbol=BTCUSDT)  
Response: {“retCode”:0,“retMsg”:“OK”,“result”:{“symbol”:“BTCUSDT”,“price”:“20290.97”},“retExtInfo”:{},“time”: 1664915455041}

Applying filters:  
.[“result”].price  
or  
.result.price  
and nothing works.  
Although when checking the filter on the site [https://jqplay.org/](https://jqplay.org/) everything works out for me, and the filter shows the correct results.

I can’t figure out why it doesn’t work?

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [October 5, 2022, 12:48pm UTC](https://community.glideapps.com/t/fetsh-json/50891/2 "2022-10-05T12:48:50Z")

</div>

Hola!

Your problem with ByBit’s link is caused by a CORS issue

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/6/169af327aec04c07d8c86cc5952b0f6013b871f4.png)

To avoid this, you have to use a CORS proxy. You can use this one and append _[https://corsanywhere.herokuapp.com/](https://corsanywhere.herokuapp.com/)_ to your URL to get a valid result.

This will look like this using as filter `.result.price`

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/694fe97d013ae8d51043ece13e4a93474caffa48.png)

Saludos!

---

<div class="post-metadata">

**Author:** ![vladilkud](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vladilkud/32/42496_2.png) [@vladilkud](https://community.glideapps.com/u/vladilkud)\
**Post date:** [October 5, 2022, 5:36pm UTC](https://community.glideapps.com/t/fetsh-json/50891/3 "2022-10-05T17:36:00Z")

</div>

@gvalero Thank you very much, everything worked.

---

<div class="post-metadata">

**Author:** ![vladilkud](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vladilkud/32/42496_2.png) [@vladilkud](https://community.glideapps.com/u/vladilkud)\
**Post date:** [October 5, 2022, 7:08pm UTC](https://community.glideapps.com/t/fetsh-json/50891/4 "2022-10-05T19:08:58Z")

</div>

@gvalero  
Now I tried to do it by analogy with the Huobi exchange, it didn’t work in both options  
Here is the request [https://api.huobi.pro/market/trade?symbol=btcusdt](https://api.huobi.pro/market/trade?symbol=btcusdt)  
returns a response, but the .tick.data.price filter does not display the value.  
But the .tick.data filter returns an array in the column.  
Tried using .tick.data[4] also fails to get price value

Request response text: {“ch”:“market.btcusdt.trade.detail”,“status”:“ok”,“ts”:1664993434014,“tick”:{“id”:160116113672,“ts”:1664993433521, “data”:[{“id”:160116113672642023896059303,“ts”:1664993433521,“trade-id”:102742476481,“amount”:0.010794,“price”:20125.11,“direction”:“buy”}]}}

Can you tell me how to deal with these fields

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [October 5, 2022, 8:59pm UTC](https://community.glideapps.com/t/fetsh-json/50891/5 "2022-10-05T20:59:00Z")

</div>

Hola de nuevo @vladilkud!

Try with `.tick.data[0].price`

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/2/7219131b18c56c406f3dd35febc531c03e1e9107.png)

Firefox can give you a better view to understand how JSON payload is returning…

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/9/f99aecf5c0cd7a7dc9973c369d48678c59604b81.png)

Saludos!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 6, 2022, 1:23am UTC](https://community.glideapps.com/t/fetsh-json/50891/6 "2022-10-06T01:23:01Z")

</div>

> [@gvalero](#):
>
> Firefox can give you a better view to understand how JSON payload is returning…

I use the JSON Formatter Chrome extension, which works quite well.

> **[JSON Formatter](https://chromewebstore.google.com/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa)**
>
> Makes JSON easy to read. Open source.

---

<div class="post-metadata">

**Author:** ![vladilkud](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/vladilkud/32/42496_2.png) [@vladilkud](https://community.glideapps.com/u/vladilkud)\
**Post date:** [October 6, 2022, 5:04pm UTC](https://community.glideapps.com/t/fetsh-json/50891/7 "2022-10-06T17:04:40Z")

</div>

@gvalero Thank you very much, everything worked with Huobi, but now ByBit writes that access is denied. Is there really no stable way to get course data from exchanges in Glide.

but in the browser everything shows by ByBit  
Error: SyntaxError: Unexpected token ‘\<’, “\<HEA”… is not valid JSON

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [October 6, 2022, 6:09pm UTC](https://community.glideapps.com/t/fetsh-json/50891/8 "2022-10-06T18:09:24Z")

</div>

Hola!

Maybe you need to create a ByBit’s Token to keep receiving new data due to your free quote is over.

Bye!

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 12:17am UTC](https://community.glideapps.com/t/fetsh-json/50891/9 "2022-11-11T00:17:01Z")

</div>

I need help, with the bybit connection, I’m going crazy anymore I don’t know what to encode in the sha 256 to be able to read the balance of the wallet,  
[https://api.bybit.com/v2/private/wallet/balance?api\_key={api\_key}&coin=BTC&timestamp={timestamp}&sign=](https://api.bybit.com/v2/private/wallet/balance?api_key=%7Bapi_key%7D&coin=BTC&timestamp=%7Btimestamp%7D&sign=){sign

This is the example that they put to fill in and make the call… but I am not able what am I doing wrong

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 12:18am UTC](https://community.glideapps.com/t/fetsh-json/50891/10 "2022-11-11T00:18:35Z")

</div>

Please help,.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [November 11, 2022, 2:47am UTC](https://community.glideapps.com/t/fetsh-json/50891/11 "2022-11-11T02:47:41Z")

</div>

Hola!

I’m going to need additional info in order to help you better but to start, I think you want to understand the Bybit’s link and its parameters:

- api\_key={api\_key} =\> Here you must type your Bybit’s API key
- coin=BTC =\> Your crypto’s ID (BTC= Bitcoin) to be searched
- timestamp={timestamp} =\> the BTC price based on this date/time value
- sign={sign} =\> I don’t understand what this parameter means 🤕

If those 4 parameters are mandatory, you have to type them when you use the Bybit’s API link.

Saludos!

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 2:49am UTC](https://community.glideapps.com/t/fetsh-json/50891/12 "2022-11-11T02:49:37Z")

</div>

Sorry for my bad English, I’m Spanish, I already know all that, something didn’t work right because I didn’t connect, I don’t know what data I have to encrypt in the sha 256

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 2:52am UTC](https://community.glideapps.com/t/fetsh-json/50891/13 "2022-11-11T02:52:22Z")

</div>

[https://bybit-exchange.github.io/docs/futuresV2/inverse/#t-wallet](https://bybit-exchange.github.io/docs/futuresV2/inverse/#t-wallet)

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 2:55am UTC](https://community.glideapps.com/t/fetsh-json/50891/14 "2022-11-11T02:55:58Z")

</div>

sign={sign} =\> I don’t understand what this parameter means  
It is understood that sign is the encryption of the API key and timestamp or something else, but it does not work for me, I tried to encrypt in a thousand ways.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 11, 2022, 3:04am UTC](https://community.glideapps.com/t/fetsh-json/50891/15 "2022-11-11T03:04:18Z")

</div>

> [@Criptomonedas](#):
>
> It is understood that sign is the encryption of the API key and timestamp or something else, but it does not work for me, I tried to encrypt in a thousand ways.

Why not just follow the instructions?

 ![Screen Shot 2022-11-11 at 11.02.48 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/c/dceaa07413ba59fffca83c70dbbc64e1e227deb9.png)

[https://bybit-exchange.github.io/docs/futuresV2/inverse/#t-constructingtherequest](https://bybit-exchange.github.io/docs/futuresV2/inverse/#t-constructingtherequest)

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 3:25am UTC](https://community.glideapps.com/t/fetsh-json/50891/16 "2022-11-11T03:25:28Z")

</div>

it doesn’t work, in python yes in glide no.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [November 11, 2022, 12:04pm UTC](https://community.glideapps.com/t/fetsh-json/50891/17 "2022-11-11T12:04:14Z")

</div>

Hola!

Puedes mostrarnos tu ejemplo en Python que si funciona para tener una referencia y probar?

May you share your example in Python to see its schema and test it?

Saludos…

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 1:00pm UTC](https://community.glideapps.com/t/fetsh-json/50891/18 "2022-11-11T13:00:55Z")

</div>

> **[pybit](https://pypi.org/project/pybit/)**
>
> Python3 Bybit HTTP/WebSocket API Connector

first install the bybit library, then use the example

> **[GitHub - bybit-exchange/api-usage-examples](https://github.com/bybit-exchange/api-usage-examples)**
>
> Contribute to bybit-exchange/api-usage-examples development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 1:07pm UTC](https://community.glideapps.com/t/fetsh-json/50891/19 "2022-11-11T13:07:37Z")

</div>

Hola, lo único que quiero es que me responda bybit con la API privada sin usar phyton desde el navegador, con las públicas ya pude hacerla funcionar en la app de glide, el problema es la codificación sha 256, estoy siguiendo los pasos como explican que codifique los valores de la cadena “pi\_key={api\_key}&coin=BTC&timestamp={timestamp}” y pasarlo a hex. Pero no funciona.

[https://api-testnet.bybit.com/v2/private/wallet/balance?api\_key={api\_key}&coin=BTC&timestamp={timestamp}&sign={sign}](https://api-testnet.bybit.com/v2/private/wallet/balance?api_key=%7Bapi_key%7D&coin=BTC&timestamp=%7Btimestamp%7D&sign=%7Bsign%7D)

Pero me devuelve error de sign

---

<div class="post-metadata">

**Author:** ![Criptomonedas](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/criptomonedas/32/49772_2.png) [@Criptomonedas](https://community.glideapps.com/u/Criptomonedas)\
**Post date:** [November 11, 2022, 1:44pm UTC](https://community.glideapps.com/t/fetsh-json/50891/20 "2022-11-11T13:44:21Z")

</div>

Yeap
