Getting data from json

Hello, I pulled the data with the api, but I can’t parse it as json. I need to parse the BTC price from the data and write it to another label.

image

Paste your json here and read the paths then deside what to do next

I want to parse and get the “price” part.

  1. You have not show your full json

  2. Have you used copy paste your json in that site??

{"status":{"timestamp":"2023-03-27T12:06:41.178Z","error_code":0,"error_message":null,"elapsed":31,"credit_count":1,"notice":null},"data":{"BTC":{"id":1,"name":"Bitcoin","symbol":"BTC","slug":"bitcoin","num_market_pairs":10124,"date_added":"2013-04-28T00:00:00.000Z","tags":["mineable","pow","sha-256","store-of-value","state-channel","coinbase-ventures-portfolio","three-arrows-capital-portfolio","polychain-capital-portfolio","binance-labs-portfolio","blockchain-capital-portfolio","boostvc-portfolio","cms-holdings-portfolio","dcg-portfolio","dragonfly-capital-portfolio","electric-capital-portfolio","fabric-ventures-portfolio","framework-ventures-portfolio","galaxy-digital-portfolio","huobi-capital-portfolio","alameda-research-portfolio","a16z-portfolio","1confirmation-portfolio","winklevoss-capital-portfolio","usv-portfolio","placeholder-ventures-portfolio","pantera-capital-portfolio","multicoin-capital-portfolio","paradigm-portfolio","btc-ecosystem"],"max_supply":21000000,"circulating_supply":19329543,"total_supply":19329543,"is_active":1,"platform":null,"cmc_rank":1,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-03-27T12:05:00.000Z","quote":{"USD":{"price":27882.726444253512,"volume_24h":14416487728.832829,"volume_change_24h":6.5906,"percent_change_1h":-0.08448902,"percent_change_24h":-0.26767372,"percent_change_7d":-1.32329396,"percent_change_30d":21.29766326,"percent_change_60d":21.23397632,"percent_change_90d":65.50706021,"market_cap":538960359761.43536,"market_cap_dominance":46.3497,"fully_diluted_market_cap":585537255329.32,"tvl":null,"last_updated":"2023-03-27T12:05:00.000Z"}}}}}

yes i did what you said

image

pls use this option after paste the json in reply…

I edited as you said.

nope. dont do with existing values… cope fresh json from the companion then paste…


or paste it in a text file and attache in next reply

json.txt (2.4 KB)

I guess the way is json.data.BTC.quote.USD.price

image

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.