Retrieving from API

I’m looking to retrieve stock opening prices from the Alpha Vantage API. There is no problem in getting the URL and testing the request, but the thing is the prices are returned in this format:

“2020-05-01 16:00:00”:{ 5 items
“1. open”: “121.4000”
“2. high”: “121.8700”
“3. low”: “121.4000”
“4. close”: “121.8300”
“5. volume”: “219717”

So when I copy the object path for the “open” price, due to the fact that it is labeled as “1. open” and then the price, the . after the 1 screws up the object path. The object path looks like this:

response.Time Series (5min).2020-05-01 16:00:00.1. open

As you can see, Voiceflow assumes that the . after the 1 is moving to a new line in determining the path, and screws it all up. Is there any way to get around this, or am I going to have to find a new API?

basically, json key should not have any dots, I think… Anyway this might be help.

I assume the API for the stock program is as follows:

https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=IBM&interval=5min&apikey=demoresponse%2ETime%20Series%20(5min)%2E2020-09-11%2019:45:00%2E1%2E%20open

The first two are objects
response.Time Series (5min)
response.Time Series (5min).2020-09-11 19:45:00

These two objects are getting read properly by VF. The problem is with the key after that where you have: 1. Open, 2. Low etc.

Here is a simple workaround.

  • First “stringify” the two json Objects
  • Next remove the dots in the 1.Open, 2. High etc…
  • Then “parse” it back to an Object
  • And read whatever values you need.

I have used the Alphavantage API and created a sample VF Project with similar data and able to get the value. .Here is the Project link.

Hope this helps.