Overview

The MeteoFranceDPObs importer facilitates access to public observations by the Meteo-France. The data is retrieved via the Meteo-France API portal. 

The data is provided under license: 

The import feature is available since August 2024, from Delft-FEWS version 2024.01 onwards.

About Meteo-France API portal

Meteo-France API portal provides access to a number of models. A catalogue of models available and their descriptions can be found at METEO FRANCE – DonneesPubliquesObservation API. To access different types of data, separate subscriptions is needed. BY default, a free subscription of 50 requests/minute is provided. 

About the data

"Real-time" data measured at stations in mainland France and overseas at hourly and/or sub-hourly time steps (6 minutes). Basic parameters (temperature, humidity, wind direction and strength, precipitation) and additional parameters according to instrumentation (temperature in the ground, visibility, ground condition, insolation, global radiation).

Documentation of the data can be found (page in french): Public Data from Météo-France - Observations of the Ground Network of France (meteofrance.fr)

Authentication and APPLICATION_ID

The Meteo-France API portal allows access by a user name and password. The credentials are linked to an APPLICATION_ID, which is needed to generate access tokens by the importer by the following way: after login Meteo-France API portal, make sure that you have subscribed to one or more datasets. Then click on the user account in connected mode (top right) > 'My API', which will list the datasets that you subscribed, as shown in Figure 1.

Figure 1: dataset that one has subscribed under his/her account.

Then choose a dataset and click button 'Generate Token'. Token will be displayed as shown in Figure 2.

Figure 2: an example of the tokens generated.

The APPLICATION_ID can be found in the curl command at the bottom of Figure 2, as seen below, where after word "Basic" is the APPLICATION_ID that we will use for FEWS configureation.

Another way to generate "Your token" is using the following command. Note: this command is for Linux machine; on windows, one needs to replace "curl" by "curl.exe" and put it in the Windows PowerShell. Moroever, in the command, replace "APPLICATION_ID" by the strings after "Basic" in Figure 2.

curl -k -X POST https://portail-api.meteofrance.fr/token -d "grant_type=client_credentials" -H "Authorization: Basic APPLICATION_ID"

Download data manualy from Meteo France

To inspect the data from Meteo France, one can download the data directly by API command outside the Delft-FEWS. A detailed instruction can be found here: https://confluence-meteofrance.atlassian.net/wiki/spaces/OpenDataMeteoFrance/pages/853934243/API+Cibl+e+Donn+es+d+Observation+EN, however, the comannds on this wepage are for Linux machines. To run these commands on a Windows machine to download data, one can do the following:

Step 1: In Figure 1, click on button "Use", this will open a new webpage where the URL for downloading can be generated, as seen in Figure 3.

Figure 3: the webpage for generating the URL where we can download the data.

Step 2: We firstly download the list of all station names, so that we know the station_id of a certain station that is in our interest. This can be done by clicking on "/list-stations" bar, and then clicking on button "Try it out". Then this gives a new button "Execute", click on it. This generates the information as shown in Figure 4, where under "Request URL" will be the URL we need. Copy this URL.

Figure 4: Generated URL from which we will download the list of station names.

Step 3: Open Windows PowerShell from the start bar, and type the following command to download the list of station names:

Curl.exe -X 'GET'  'https://public-api.meteofrance.fr/public/DPObs/v2/liste-stations'  -H 'accept: */*'   -H 'Authorization: Bearer <Your token>' -JO

where, the URL in this command is copied from the previous step, and after "bearer", paste the long "Your token" from Figure 1. (Note: the URL might change due to update, e.g. now it is v2 and it used to be v1. Moreover, the long "Your token" might also needs to be generated again since it has a time limit to be valid.)

The downloaded file can be found here: "C:\Users\<name>\liste-stations-obs-metropole-om.csv". Open it and choose one station's id that you want data from.

Step 4: now we can download data for a ceratin station, for a certain date and time. To get the corresponding URL, we can use the tool on the webpage: go to the webpage shown in Figure 3. If one wants to download an hourly data, then click on the bar of "/station/horaire", and then click on button "Try it out". Afterwards it shows as in Figure 5. 

Figure 5: Generating URL for downloading data from a certain station at a certain time with a ceratin format.

Now one can fill in for "id_station", which can be found from the list of station names downloaded in Step 3. Fill in the "date" but using the format they requred: UTC: AAAA-MM-JJThh:mm:ssZ) Then choose the format of the data file that you are going to download. Then click on button "Execute", which will generate a URL, one example is shown in Figure 6. Copy this URL.

Figure 6: an example of generating URL for downloading data from a certain station at a certain time with a ceratin format.

Step 5: In PowerShell, put the following command:

Curl.exe -X 'GET' 'https://public-api.meteofrance.fr/public/DPObs/v2/station/horaire?id_station=01014002&date=2024-05-06T13%3A48%3A56Z&format=csv' -H 'accept: */*' -H 'Authorization: Bearer <Your token>' -JO

where, the URL in this command is copied from the previous step, and after "bearer", paste the long "Your token" from Figure 1. (Note: the URL might change due to update, e.g. now it is v2 and it used to be v1. Moreover, the long "Your token" might also needs to be generated again since it has a time-limit to be valid.)

The downloaded file can be found here: "C:\Users\<name>\obs-horaire_88033002_2026-07-08T13_00_00Z.csv". 

Configuration (Example)

A complete import module configuration consists of an ID Mapping file and a Import Module Instance file. To convert the rainfall in a proper unit (from 1 kg_m2 per hour to mm/hr for example) it is also required to configure a Unit Conversion file.

ModuleConfigFiles

The following example of an Import Module Instance will import the AROME model with 0.1 resolution for France at hourly timestep over the complete forecast period from 0 to 24 hour leadtime.

Import_DPObs.xml
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
    <import>
        <general>
            <importType>MeteoFranceDPObs</importType>
            <serverUrl>https://public-api.meteofrance.fr/public/DPObs/v1/station/infrahoraire-6m</serverUrl>

            <!-- serverUrl>https://public-api.meteofrance.fr/public/DPObs/v1/station/horaire</serverUrl-->

            <!-- If use the /horaire URL, use a 1 hour timestep-->
            <relativeViewPeriod unit="hour" start="0" end="2"/>
            <table>
                <locationColumn name="geo_id_insee"/>
                <dateTimeColumn name="validity_time" pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"/>
                <valueColumn name="t"/>
                <valueColumn name="td"/>
                <valueColumn name="u"/>
                <valueColumn name="dd"/>
                <valueColumn name="ff"/>

                 <! – More value columns -->
            </table>
        </general>
        <properties>
            <string key="tokenUrl" value="https://portail-api.meteofrance.fr/token"></string>
            <string key="applicationId" value="$APPLICATION_ID$"></string>
        </properties>
        <timeSeriesSet>
            <moduleInstanceId>Import_DPObs</moduleInstanceId>
            <valueType>scalar</valueType>
            <parameterId>ff</parameterId>
            <locationId>59183001</locationId>
            <timeSeriesType>external historical</timeSeriesType>
            <timeStep  unit="minute" multiplier="6"/>
            <readWriteMode>read only</readWriteMode>
            <expiryTime unit="day" multiplier="365"/>
        </timeSeriesSet>
        <timeSeriesSet>
            <moduleInstanceId>Import_DPObs</moduleInstanceId>
            <valueType>scalar</valueType>
            <parameterId>ff</parameterId>
            <locationId>34311001</locationId>
            <timeSeriesType>external historical</timeSeriesType>
            <timeStep  unit="minute" multiplier="6"/>
            <readWriteMode>read only</readWriteMode>
            <expiryTime unit="day" multiplier="365"/>
        </timeSeriesSet>
    </import>
</timeSeriesImportRun>


About server url

The serverUrl is used to select the product to import. Choose between the url for 6 minutes data or for hourly data.

About the subscription

The default free subscription from Meteo-France covers only 50 request per data. One request is needed to download one timestamp for a single location. Hence the number of requests needed can be computed by X timesteps multiplied by Y locations. In case of more requests are needed, it is possible to contact Meteo-France for a paid subscription. If the number of requests exceed the subscription, an ERROR will be issued.  Data that are downloaded before the error occurs will be imported. 




  • No labels