# Getting Started

## Basic Examples

The endpoints `/climate/tmy`, `/observation/realtime`,
`/forecast/basic` and \
`/forecast/precision` all have meaningful
default arguments, with only `lat` and `lon` being required.

Note: These examples use our demo API URL. **No registration required!**
See [Free lat/lon locations](./overview/demo) for more information on how you can test the
Meteonorm API free of charge. For operational use, replace `demo.meteonorm.com` with
`api.meteonorm.com` and the API key `demo0000-...` with a real key.

<Tabs>
  <Tab value="bash">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" \
        --get \
        --data "lat=50" \
        --data "lon=10" \
        "https://demo.meteonorm.com/v1/climate/tmy"
    ```
  </Tab>

   <Tab value="cmd">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" ^
        --get ^
        --data "lat=50" ^
        --data "lon=10" ^
        "https://demo.meteonorm.com/v1/climate/tmy"
    ```
  </Tab>

  <Tab value="powershell">
    ```sh
    $url = "https://demo.meteonorm.com/v1/climate/tmy?lat=50&lon=10"
    $headers = @{ Authorization = "Bearer demo0000-0000-0000-0000-000000000000" }

    $response = Invoke-WebRequest -Uri $url -Headers $headers
    $response.Content
    ```
  </Tab>
</Tabs>

<Tabs showButtons={false}>
  <Tab value="bash">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" \
        --get \
        --data "lat=50" \
        --data "lon=10" \
        "https://demo.meteonorm.com/v1/observation/realtime"
    ```
  </Tab>

   <Tab value="cmd">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" ^
        --get ^
        --data "lat=50" ^
        --data "lon=10" ^
        "https://demo.meteonorm.com/v1/observation/realtime"
     ```
  </Tab>

  <Tab value="powershell">
    ```sh
    $url = "https://demo.meteonorm.com/v1/observation/realtime?lat=50&lon=10"
    $headers = @{ Authorization = "Bearer demo0000-0000-0000-0000-000000000000" }

    $response = Invoke-WebRequest -Uri $url -Headers $headers
    $response.Content
     ```
  </Tab>
</Tabs>

<Tabs showButtons={false}>
  <Tab value="bash">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" \
        --get \
        --data "lat=50" \
        --data "lon=10" \
        "https://demo.meteonorm.com/v1/forecast/basic"
    ```
  </Tab>

   <Tab value="cmd">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" ^
        --get ^
        --data "lat=50" ^
        --data "lon=10" ^
        "https://demo.meteonorm.com/v1/forecast/basic"
     ```
  </Tab>

  <Tab value="powershell">
    ```sh
    $url = "https://demo.meteonorm.com/v1/forecast/basic?lat=50&lon=10"
    $headers = @{ Authorization = "Bearer demo0000-0000-0000-0000-000000000000" }

    $response = Invoke-WebRequest -Uri $url -Headers $headers
    $response.Content
     ```
  </Tab>
</Tabs>

<Tabs showButtons={false}>
  <Tab value="bash">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" \
        --get \
        --data "lat=50" \
        --data "lon=10" \
        "https://demo.meteonorm.com/v1/forecast/precision"
    ```
  </Tab>

  <Tab value="cmd">
    ```sh
    curl -H "Authorization: Bearer demo0000-0000-0000-0000-000000000000" ^
        --get ^
        --data "lat=50" ^
        --data "lon=10" ^
        "https://demo.meteonorm.com/v1/forecast/precision"
     ```
  </Tab>

  <Tab value="powershell">
    ```sh
    $url = "https://demo.meteonorm.com/v1/forecast/precision?lat=50&lon=10"
    $headers = @{ Authorization = "Bearer demo0000-0000-0000-0000-000000000000" }

    $response = Invoke-WebRequest -Uri $url -Headers $headers
    $response.Content
     ```
  </Tab>
</Tabs>

All these requests will return a JSON response containing a time series.

Example of a response:

```json
{
   "start_times" : [
      "2025-04-22T12:00:00Z", "2025-04-22T13:00:00Z", "2025-04-22T14:00:00Z",
      ...
   ],
   "end_times" : [
      "2025-04-22T13:00:00Z", "2025-04-22T14:00:00Z", "2025-04-22T15:00:00Z",
      ...
   ],
   "values" : {
      "global_horizontal_irradiance" : [
         305, 309, 209, ...
      ],
      "temperature" : [
         4.9, 4.9, 5.0, ...
      ],
      "diffuse_horizontal_irradiance" : null,
      "diffuse_horizontal_irradiance_with_shading" : null,
      ...
   },
   "meta" : {
      "lat" : 50,
      "lon" : 10,
      "altitude" : 290,
      "frequency" : "1_hour",
      "surface_azimuth" : 0,
      "surface_tilt" : 0,
      "parameters" : [
         {
            "name" : "global_horizontal_irradiance",
            "description" : "Global horizontal irradiance",
            "unit" : {
               "description" : "Watt per square meter",
               "name" : "W/m**2"
            },
            "aggregation_method" : "average"
         },
         {
            "name" : "temperature",
            "description" : "Air temperature, 2 m above ground.",
            "unit" : {
               "description" : "degrees Celsius",
               "name" : "°C"
            },
            "aggregation_method" : "average"
         }
      ]
   }
}
```

Explanations:

*  In order to avoid any ambiguity, the start and end of every time interval is defined
explicitely.
*  The `"values"` attribute of the response contains keys for all
the parameters available for the endpoint, with non-requested parameters set to `null`.

<a href="/openapi.yaml" download="openapi.yaml">Download the OpenAPI file</a>
