SoilGrids banner


REST service description and discovery. Service supports the following HTTP-Verbs: HEAD   OPTIONS   GET   POST


Support for Cross-origin resource sharing (CORS) is: ENABLED


If you are unfamiliar with CORS check wikipedia [More...]

Good explanation on OPTIONS usage and potential [More...]

Mozilla developers page on CORS and Pre-Flight [More...]


Using linux bash and the command curl to make the OPTIONS and HEAD calls [More...]


OPTIONS: /query

Description:
  • HTTP-OPTIONS support for Content-Type discovery and supported HTTP verbs
Request:
  • curl -v -X OPTIONS https://rest.soilgrids.org/query
  • > OPTIONS /query HTTP/1.1
    > User-Agent: curl/7.32.0
    > Host: rest.soilgrids.org
    > Accept: */*
    > 
    
    < HTTP/1.1 200 OK
    < Date: Wed, 19 Mar 2014 17:04:30 GMT
    < Server: Apache/2.2.22 (Ubuntu)
    < Allow: HEAD, OPTIONS, GET
    < Content-Length: 0
    < Access-Control-Allow-Origin: *
    < Content-Type: application/json
    < Vary: User-Agent
    < Connection: close
    < 
    
Explanation:
  • Returned object mimeType: application/json
  • Returned object is a GeoJSON [More...]
  • Allowed verbs: HEAD, OPTIONS, GET

OPTIONS: /stream

Description:
  • HTTP-OPTIONS support for Content-Type discovery and supported HTTP verbs
Request:
  • curl -v -X OPTIONS https://rest.soilgrids.org/stream
  • > OPTIONS /stream HTTP/1.1
    > User-Agent: curl/7.32.0
    > Host: rest.soilgrids.org
    > Accept: */*
    > 
    
    < HTTP/1.1 200 OK
    < Date: Thu, 20 Mar 2014 10:08:46 GMT
    < Server: Apache/2.2.22 (Ubuntu)
    < Allow: HEAD, GET, POST, OPTIONS
    < Content-Length: 0
    < Access-Control-Allow-Origin: *
    < Content-Type: application/zip
    < Set-Cookie: fileDownload=true; path=/
    < Vary: User-Agent
    < Connection: close
    < 
    
    
Explanation:
  • Returned object mimeType: application/file
  • Returned object is a zip file with name format: files_<UNIXTIME>.zip
  • File zipped is streamed from server therefore it is impossible to determine the size or reponse
  • Allowed verbs: HEAD, OPTIONS,GET,POST

HEAD: /query

Description:
  • HTTP-HEAD support. Normally used to determine is a web service is responsive
Request:
  • curl -v -X HEAD https://rest.soilgrids.org/query
  • > HEAD /query HTTP/1.1
    > User-Agent: curl/7.32.0
    > Host: rest.soilgrids.org
    > Accept: */*
    > 
    < HTTP/1.1 400 BAD REQUEST
    < Date: Thu, 20 Mar 2014 13:28:43 GMT
    < Server: Apache/2.2.22 (Ubuntu)
    < Content-Length: 192
    < Access-Control-Allow-Origin: *
    < Vary: Accept-Encoding,User-Agent
    < Content-Type: text/html
    < Connection: close
    < 
    
    
Explanation:
  • Almost like GET but without a body content
  • Warning HTTP/1.1 400 BAD REQUEST in Response.

      Apache server (unlike Flask-WSGI-Server) doesn't differenciate between GET and HEAD. Therefore a HEAD request without proper query parameter will raise a BAD REQUEST

  • Request HTTP 200 curl -v -G -d 'lon=1.0&lat=1.0' -X HEAD https://rest.soilgrids.org/query

HEAD: /stream

Description:
  • HTTP-HEAD support. Normally used to determine is a web service is responsive
Request:
  • curl -v -X HEAD https://rest.soilgrids.org/stream
  • > HEAD /query HTTP/1.1
    > User-Agent: curl/7.32.0
    > Host: rest.soilgrids.org
    > Accept: */*
    > 
    < HTTP/1.1 400 BAD REQUEST
    < Date: Thu, 20 Mar 2014 13:09:03 GMT
    * Server Apache/2.2.22 (Ubuntu) is not blacklisted
    < Server: Apache/2.2.22 (Ubuntu)
    < Content-Length: 192
    < Access-Control-Allow-Origin: *
    < Vary: Accept-Encoding,User-Agent
    < Content-Type: text/html
    < Connection: close
    < 
    
Explanation:
  • Almost like GET but without a body content
  • Warning HTTP/1.1 400 BAD REQUEST in Response.

      Apache server (unlike Flask-WSGI-Server) doesn't differenciate between GET and HEAD. Therefore a HEAD request without proper query parameter will raise a BAD REQUEST

  • Request HTTP 200 curl -v -G -d 'clipList=T462&param=FOOO' -X HEAD https://rest.soilgrids.org/stream