This service is a typical REST API and it uses HTTP as communication protocol. It is only designed for retrieval of data so you should only use requests with the HTTP verb
. It is important that the clients respect the HTTP status codes, and only use data returned in combination with the HTTP status code 200. The service supports the header
Accept-Encoding: gzip, deflate
. Use it if your client handles gzipped content to decrease download time.
The service uses a handful of formats for the service protocol. Clients may use any one of these formats and can switch between formats at any time. To specify which one to use, a suffix is appended to the URL. Note that all formats are not available for all resources. See Mediatypes for more information.
Typical requests and responses
The API is based on four primary mediatypes. There may also be references to other mediatypes (i.e. for metadata) but these are not included in this documentation.
For all resources except Data a client can use
. If no suffix is specified then
is used as the default mediatype.
All Data are available as
. There is no default mediatype for Data so a suffix must be specified.
||application/atom+xml||Category, Version, Year, Month, Day||This is the default mediatype for all resources except Data. If no suffix is specified in the request to these resources, then
||application/xml||Category, Version, Year, Month, Day||This mediatype is based on a set of xml-schema and is the primary mediatype for the API|
||application/json||Category, Version, Year, Month, Day||This mediatype is not based on any schema but should be stable enough to build upon|
||application/zip||Data||This mediatype is used for Data only. It is not used for other resources.|
You should write your application to handle any HTTP code, but the following is most common
|200||The request is ok and you can consume the resource.|
|404||The request points to a resource that do not exist. This might happen if you query for a station that do not produce data for a specific parameter or you are using a deprecated version of the API that has been removed. It might also be the case that the specified station do not have any data for the latest hour.|
|500||Something went wrong internally in the system. This might be fixed after a while so try again later on.|