FromJSON in Shiny App

Hi everyone,

I made a shiny application. In this application, my data comes from JSON query but it works in local but it does not work in

Please, please and please help me...

My query:

    ispark_refresh <-reactive({
fromJSON("",flatten = T)

My Log:

It looks like the URL that you are trying to reach is not responding to requests from This could be for many reasons - either the request that is being made is in such a way that the API is not responding, or the API has some type of firewall rule set up that blocks requests, etc. I just tried this and things worked fine for me though (from local and from! I just used system("curl -i"). It might be worth doing some exploration rather than just using fromJSON. For instance:

  • httr::content(httr::GET(""), as = "text")
  • system("curl -i")

You could also throw these in the global part of the Shiny app startup (right around the library() commands and such) to ensure there is not something weird going on with reactivity!

It's also possible that something has changed in networking / security of this API since you submitted the request, which is why requests work for me now?


Dear Cole,

Thank you for your repsonse!!

How will I turn to dataframe this structure without fromjson function?

httr::content(httr::GET(""), as = "text")

Colnames must be: "ParkID", "Latitude","Longitude","Kapasitesi","BosKapasite","ParkTipi","Ilce","Distance","UcretsizParklanmaDk"

For the second code:

system("curl -i")

Screenshot of output:

Perfect!! It's working!! Is jsonlite::fromJSON() (I presume you are using jsonlite?) still failing?

If this works, but fromJSON still fails, you may want to submit a bug in the jsonlite package.

In the meantime, though - once you have the text value, you can then convert a few different ways:

# will give you a "parsed" list output
httr::content(httr::GET(""), as = "parsed")

# use `fromJSON` on the string itself
jsonlite::fromJSON(httr::content(httr::GET(""), as = "text"))

OMG!!! It is worked!!!!! Thank you Mr. Cole!!!!!!!! :upside_down_face: :upside_down_face: :upside_down_face:

1 Like

Woohoo!! Glad to hear! Well done! :smile:

1 Like

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