Using the SoilGrids ReST interface

All the maps produced in SoilGrids are accessible through a ReST service, reachable at The service accepts queries using the following parameters:

  • location
  • variable (soil property, class, etc)
  • standard depth level

Only the location is mandatory, with the other parameters used to narrow down the query. Passing only the location as parameter will obtain the complete information available for all variables. Please visit the  service page for more details.

The ReST service is presently the most convenient way of accessing SoilGrids from a computer programme or a script. Below are some examples in various programming languages popular among Earth scientists.



For R there is the jsonlite package, that automatically parses the JSON response returned by the service. It can be used like this:

coords <- c(45.5, 37.8)
fromJSON(paste0('',coords[1],'&lat=',coords[2],',&attributes=BLDFIE,SLTPPT,SNDPPT,CLYPPT'), flatten = TRUE)



In Julia, it is possible to use the HTTP package to query the service and then the JSON package to parse the response.

using HTTP
using JSON
coords = [45.5, 37.8]
resp = HTTP.request("GET", string("",coords[1] ,"&lat=", coords[2], "&attributes=BLDFIE,SLTPPT,SNDPPT,CLYPPT"))



In Python a request to the service can be made with the requests package, which automatically parses the JSON response into a dictionary.

import requests 
coords = [45.5, 37.8] 
resp = requests.get("" + str(coords[0]) + "&lat=" + str(coords[1]) + "&attributes=BLDFIE,SLTPPT,SNDPPT,CLYPPT")