Request

Request URL

Request to Apixu API consists of base url and API method. You can make both HTTP or HTTPS request to our API.

Base URL: http://api.apixu.com/v1

API API Method
Current weather /current.json or /current.xml
Forecast /forecast.json or /forecast.xml
Search or Autocomplete /search.json or /search.xml
History /history.json or /history.xml

Request Parameters

Parameter Description
key Required API Key
q Required

Query parameter based on which data is sent back. It could be following:

  • Latitude and Longitude (Decimal degree) e.g: q=48.8567,2.3508
  • city name e.g.: q=Paris
  • US zip e.g.: q=10001
  • UK postcode e.g: q=SW1
  • Canada postal code e.g: q=G2J
  • metar:<metar code> e.g: q=metar:EGLL
  • iata:<3 digit airport code> e.g: q=iata:DXB
  • auto:ip IP lookup e.g: q=auto:ip
  • IP address (IPv4 and IPv6 supported) e.g: q=100.0.0.1
days Required only with forecast API method.

Number of days of forecast required.

days parameter value ranges between 1 and 10.e.g: days=5

If no days parameter is provided then only today's weather is returned.

dt (Required for History API) Restrict date output for Forecast and History API method.

For history API 'dt' should be on or after 1st Jan, 2015 in yyyy-MM-dd format (i.e. dt=2015-01-01)

For forecast API 'dt' should be between today and next 10 day in yyyy-MM-dd format (i.e. dt=2015-01-01)

(Optional) unixdt Unix Timestamp used by Forecast and History API method.

unixdt has same restriction as 'dt' parameter. Please either pass 'dt' or 'unixdt' and not both in same request. e.g.: unixdt=1490227200

(Optional) end_dt (Available for History API) Restrict date output for History API method.

For history API 'end_dt' should be on or after 1st Jan, 2015 in yyyy-MM-dd format (i.e. dt=2015-01-01)

'end_dt' should be greater than 'dt' parameter and difference should not be more than 30 days between the two dates.

(Optional) unixend_dt Unix Timestamp used by History API method.

unixend_dt has same restriction as 'end_dt' parameter. Please either pass 'end_dt' or 'unixend_dt' and not both in same request. e.g.: unixend_dt=1490227200

(Optional) hour Restricting forecast or history output to a specific hour in a given day.

Must be in 24 hour. For example 5 pm should be hour=17, 6 am as hour=6

(Optional) lang Returns 'condition:text' field in API in the desired language

Please pass 'lang code' from below table. e.g.: lang=fr

Language lang code
Arabicar
Bengalibn
Bulgarianbg
Chinese Simplifiedzh
Chinese Traditionalzh_tw
Czechcs
Danishda
Dutchnl
Finnishfi
Frenchfr
Germande
Greekel
Hindihi
Hungarianhu
Italianit
Japaneseja
Javanesejv
Koreanko
Mandarinzh_cmn
Marathimr
Polishpl
Portuguesept
Punjabipa
Romanianro
Russianru
Serbiansr
Sinhalesesi
Slovaksk
Spanishes
Swedishsv
Tamilta
Telugute
Turkishtr
Ukrainianuk
Urduur
Vietnamesevi
Wu (Shanghainese)zh_wuu
Xiangzh_hsn
Yue (Cantonese)zh_yue
Zuluzu