Hey there! I'm currently working on extracting a specific part of the response from the {}. This information is retrieved from the gemini public database, and my goal is to retrieve only the content within the curly braces and store it as a string in a database.
const gemini = async() =>{
var burl = 'https://api.sandbox.gemini.com'
var query = '/v1/pubticker/'+'ethusd'
var url = burl + query
var smth = fetch(url)
delete smth.vary
return smth
}
export default gemini
Below is the response that I receive:
status: 200 OK
content-length: 133
content-type: application/json
date: Mon, 08 Nov 2021 18:03:09 GMT
server: nginx
vary: Origin
{"bid":"4786.52","ask":"4787.78","volume":{"ETH":"8232.886562","USD":"38693689.50955448","timestamp":1636394400000},"last":"4786.83"}
This is the specific portion I want to isolate:
{"ETH":"8232.886562","USD":"38693689.50955448","timestamp":1636394400000},"last":"4786.83"}