I am using the data which is available in the links below to get data about confirmed cases for COVID-19 in Colombia. I am modeling the cumulative cases with a non linear model and all is fine. This has been made by downloading the data to work locally. I know that there are mechanisms for web development and much what I need I found in this community, except I do not know how to make the graphics update automatically from the data found in the links in a web page.



Thanks for your suggestions!


1 Answer 1


It appears to use Socrata to manage the data. I have no experience with this API, but it appears you can access it using this form of the URL:


According to the Socrata documentation, you can request this data at a particular $offset and $limit by providing these as parameters in the URL. This is a bit niche, and beyond the scope of Mathematica Stack Exchange, but this will hopefully get you started:

(* fetch 10 records starting from offset 0 *)
request = 
   <| Method -> "GET", "Query" -> {"$limit" -> 10, "$offset" -> 0}, 
    CharacterEncoding -> "UTF8"|>];
response = URLExecute[request];

We can then query properties of the response JSON by forming an Association:

(* of our 10 records, get the first 5 cities of location *)
Association[#]["ciudad_de_ubicaci_n"] & /@ response[[1 ;; 5]]
(* {"Bogotá D.C.", "Guadalajara de Buga", "Medellín", "Medellín", "Medellín"} *)

If you want the total number of entries in the database (cases) then I reckon you could use the API like this $select=count(id_de_caso):

request = 
   <| Method -> "GET", 
      "Query" -> {"$select" -> "count(id_de_caso)", "$offset" -> 0}, 
      CharacterEncoding -> "UTF8"|>];
response = URLExecute[request];

numberOfCases = ToExpression@Values[First[response]][[1]]

(* 456689 *)

This matches up exactly with the data for Columbia at https://www.trackcorona.live/map as of 16th August 2020.

  • $\begingroup$ Thank you for your response, I really appreciate the elaboration. I will begin to study it. $\endgroup$
    – DIEGO R.
    Aug 16, 2020 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.