Skip to content

Instantly share code, notes, and snippets.

@Altoidnerd
Last active February 19, 2025 20:12
Show Gist options
  • Save Altoidnerd/73fa3def534e6f310ac9 to your computer and use it in GitHub Desktop.
Save Altoidnerd/73fa3def534e6f310ac9 to your computer and use it in GitHub Desktop.
world bank clime API requests

make climate API requests

examples

http://climatedataapi.worldbank.org/climateweb/rest/v1/country/annualavg/pr/1980/1999/USA.csv

http://climatedataapi.worldbank.org/climateweb/rest/v1/country/annualavg/pr/1980/1999/USA.json

doc

basic request

The Climate Data API uses REST-based requests, in which the general form looks like this:

http://climatedataapi.worldbank.org/climateweb/rest/v1/country/type/var/start/end/ISO3[.ext]

type is one of:

mavg Monthly average annualavg Annual average manom Average monthly change (anomaly). The control period is 1961-1999 for temperature and precipitation variables, and 1961-2000 for derived statistics. annualanom Average annual change (anomaly). The control period is 1961-1999 for temperature and precipitation variables, and 1961-2000 for derived statistics. var is one of:

pr Precipitation (rainfall and assumed water equivalent), in millimeters tas Temperature, in degrees Celsius The start and end time period variables must be paired as follows (note that past time periods are estimated and not actual values, as described previously):

ISO3 is an ISO3 country code, indicating the country for the data request.

ext is optional, and indicates the response type: CSV, JSON or XML (the default is JSON). For JSONP support, add the query parameter "?callback=handler" where "handler" is the name of your callback function.

@rash1411
Copy link

This site is showing error while opening .
Is there any alternative?

@BusuyiOAdebayo
Copy link

The server returned the status 404 error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment