How to parse this URL

cryptophan

Did you follow the installation instructions on that page?

yes...

the code is working well in other website like this one

Code:
Sub getADA()

    Set MyRequest = CreateObject("winhttp.winhttprequest.5.1")
    MyRequest.Open "GET", "https://vip.bitcoin.co.id/api/ada_idr/ticker"
    MyRequest.send
    'MsgBox myrequest.responsetext
    
    Dim JSON As Object
    Set JSON = JsonConverter.ParseJSON(MyRequest.ResponseText)
    
    Range("C4") = JSON("ticker")("last")
   
End Sub

but it is error on this https://api.binance.com/api/v3/ticker/price?symbol=ADABTC
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi Cryptophan,

I was tying to solve the same problem with the JsonConverter. Have you managed to solve the problem yet?

The code I have:

_________________________________________________________________

Sub Ticker()

Set wh = CreateObject("winhttp.winhttprequest.5.1")

Url = "https://api.binance.com/api/v3/ticker/price"

wh.Open "get", Url
wh.Send
wh.WaitForResponse
wh.ResponseText

Set wh = Nothing

Dim Json As Object
Dim result As Dictionary

Set Json = JsonConverter.ParseJson(wh.ResponseText)

For Each result In Json("results")

Debug.Print result("symbol")
Debug.Print result("price")

Next

Dim WrkSht As Worksheet
Set WrkSht = ThisWorkbook.Worksheets("json")


Count = 1

For Each result In Json("results")

WrkSht.Cells(Count, 1).Value = result("symbol")

WrkSht.Cells(Count, 2).Value = result("price")


Count = Count + 1

Next

End Sub
_________________________________________________________________


Many thanks
 
Upvote 0

Forum statistics

Threads
1,215,917
Messages
6,127,703
Members
449,399
Latest member
VEVE4014

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top