General API use
Help! I am getting 429 Too Many Requests! What am I doing wrong?
You are probably using a blank User-Agent header, or a generic one like "wget/1.12" or (for apps) "Dalvik/2.1.0". The Terms of Service clearly states that you must identify yourself in the User-Agent header. If this is generic or missing you will be throttled (for old products) or blocked (for new products from 2020 onwards).
If you're still getting 429s, you are probably hitting us with too much traffic and have been permanently throttled. Please contact us for advice on how to enhance your calm. Make sure to include your IP address and User-Agent in your message.
Now I'm suddenly getting "403 Forbidden"! Why am I blocked?
Newer services like Locationforecast/2.0 have stricter rules and will block instead of throttle if the User-Agent is missing or generic. Again, read the Terms of Service before contacting us.
On the other hand it can also mean you have been found to break the TOS in other ways and have been blacklisted, e.g. by pretending to be another website or client, or slamming us with too much traffic. In some cases this might be reversed when the problem is fixed, but deliberate breaches of the TOS will result in a permanent ban.
Do you support unencrypted HTTP requests?
No, since version 3 we only support HTTPS for security reasons, as required by Norwegian law. Since this is somewhat inconvenient when using the site we will redirect legitimate HTTP requests from browsers to HTTPS on an experimental basis. However, if we detect traffic where every HTTPS call is preceded by a HTTP call, this is likely to be blocked.
How can I access WeatherAPI data via QGIS (or any other GDAL-based application)?
GDAL by default does not send a User-Agent header, which causes a 403 Forbidden response.
You must set this explicitly in an environment variable (we presume you are using a
UNIX/Linux based platform here). Add the following line to your environment (e.g.
.profile or similar):
$ export GDAL_HTTP_USERAGENT="QGIS vXXX/YYY (email@example.com)"
The email address is to fulfil the requirement for contact information in case you exceed the traffic limits; without you will be blocked without warning. Also note that trying to mimic browser User-Agent headers is in violation of the TOS which can lead to blocking.
Do you support content negotiation (using the
We tried to support this experimentally a short time after launching version 3.0 of the API, but it generated a lot of problems and had to be abandoned. Specifically, it does not work with caching proxies who tend to serve XML to requests for JSON unless the Accept header is part of the cache key. Since there are literally thousands of different permutations of format in the various Accept headers, this would defeat the point of having a cache.
Also, setting the Accept header is not allowed in "simple" CORS requests; instead you must for that use a "preflight" and configure the server to recognize each client (something which is not possible with the hundreds of thousands of users of our API).
Content negotiation was a good ide in principle, but has been an absolute failure in practice. Unfortunately it is still part of the Swagger/OpenAPI spec, which is why you will see some fields in the API UI where you can specify content type; this is ignored by the API.
What does restrictions on some data mean?
Some data referred to in the documentation is not freely available, mostly because the data is not ours. We have the right to use the data, but not to distribute them. This is marked in the documentation for each product in a section called Restrictions. For more information regarding this issue, please see our Licensing and Data Policy.
Currently there are no longer any restricted data served via api.met.no.
Do you support gzip compression of HTTP data?
Yes. We will serve gzip compressed data of appropriate MIME types. See General Usage for more information.
Earlier you used semicolons as parameter separators in the query string, now you're using ampersands. What's the deal?
Semicolons were introduced as an optional alternative to ampersands
after requests from developers using badly designed tools for parsing
and generating XML. Since the semicolon did not need to be escaped in
XML (unlike the ampersand which had to be coded as
&), this made
generating URLs easier, completely ignoring that they should instead
be url-encoded as
%3B instead (and thus opening another kind of worms
when these two cases had to be handled differently).
According to the new HTML5 specification, semicolon is no longer accepted as a valid parameter separator. This actually means that a request using unescaped semicolons in the query string must be processed differently for a HTML5 server than for HTML 4.x. For this reason we have reverted to the standard usage.
Q. What does the wave direction mean? Is it "coming from" or "going to"?
For Oceanforecast/0.9 and Gribfiles/1.1 we have used oceanographic convention for waves (i.e. where they are "going to"), just as we do for currents. Example:
<mox:mean\TotalWaveDirection uom="deg">45.2</mox:mean\TotalWaveDirection> <mox:sea\CurrentDirection uom="deg">131.4</mox:sea\CurrentDirection>
Unfortunately, a lot of software (e.g. navigation systems) expect the opposite, so that when reading the GRIB files with a map plotter the wave arrows will be shown the wrong way. Therefore, for Oceanforecast/2.0 and newer products (2021 onwards) we will be using meteorological convention for waves (i.e. where they are "coming from"), just as we do for wind. Please see the Oceanforecast Data Model documentation.
Q. Are historic solar energy data available?
A: Historic predictions of the solar energy that reaches the earth surface is available from the archive of our weather prediction model on THREDDS.
Q. Do you have interpolated observational data available for download?
Yes. Real-time data are available here (PREC1d=daily precipitation; TEMP1d=daily averaged temperature; data for day D encompass the time interval from day D-1 0600 UTC to day D 0600 UTC):
Here you find the archives:
Here archives of seNorge2 based on MET Norway data + ECA&D data:
xgeo.no and senorge.no are also possible options.
Contact Christian Lussana for more information.2020-04-15, Geir Aalberg