# Trends

**All statistics are calculated in the local time without shifts for daylight saving time of the station where the data originated from.<br>Daily aggregates will report the trend in ppbv/day and monthly aggregates will report the trend in ppbv/month.**

[https://toar-data.fz-juelich.de/api/v2/analysis/trends/[?QUERY-OPTIONS]](https://toar-data.fz-juelich.de/api/v2/analysis/trends/)

where QUERY-OPTIONS are:

any combination of query options from both [TOARDB REST interface - 2.4 Stationmeta](https://toar-data.fz-juelich.de/api/v2/#stationmeta) and [TOARDB REST interface - 2.5 Timeseries](https://toar-data.fz-juelich.de/api/v2/#stationmeta)
<br><br>daterange = \<list of two datetimes: date range for which to extract data\>
<br><br>flags = \<list of strings: only select data points with the specified quality flags\> (for a description of flags and all available flag names see User Guide - [5.2 Data Quality Flags](https://toar-data.fz-juelich.de/sphinx/TOAR_UG_Vol03_Database/build/html/data-quality.html#data-quality-flags))
<br><br>sampling = \<string: temporal aggregation to use\> (daily|monthly)
<br><br>statistics = \<list of strings: statistics to calculate\> (for available values and details see [5.2. Available Statistics](available_statistics) )
<br><br>seasons = \<list of strings: seasons to use for seasonal aggregations\> (for available values see [SEASON_DICT](https://gitlab.jsc.fz-juelich.de/esde/toar-public/toarstats/-/blob/master/toarstats/metrics/constants.py#L93-147)) (default: "DJF,MAM,JJA,SON")
<br><br>crops = \<list of strings: crops to use for vegseason aggregations\> (for available values see [ALLOWED_CROPS_VALUES](https://gitlab.jsc.fz-juelich.de/esde/toar-public/toarstats/-/blob/master/toarstats/metrics/constants.py#L149-152)) (default: "wheat,rice")
<br><br>min_data_capture = \<number: minimal fraction of available hourly values in the aggregation interval to report an aggregated value, must be between 0 and 1\> (default: 0.75)
<br><br>method = \<string: regression analysis method to use\> (OLS|quant) (default: quant)
<br><br>quantiles = \<list of numbers: quantiles to use when using quantile regression, must be between 0 and 1\>
<br><br>num_samples = \<number: number of sampled trends in moving block bootstrap\> (default: 50)
<br><br>metadata_scheme = \<string: select how much metadata is returned\> (basic|extended|full) (default: full)
<br><br>format = \<string\> (json_simple|by_stat_quant) (for details on the formats see Reference [8. Aggregated Output Formats](aggregated_output_formats) )(default: json_simple)

<br>**Response:** The query will return a unique task identifier and a link to check the status of your query.
<br>**Example:** [https://toar-data.fz-juelich.de/api/v2/analysis/trends/?country=DE&variable_id=5&limit=3&daterange=2010-01-01T00:00:00,2020-12-31T23:59:59&flags=AllOK&sampling=monthly&statistics=avgdma8epax,dma8eu&quantiles=0.25,0.5,0.75](https://toar-data.fz-juelich.de/api/v2/analysis/trends/?country=DE&variable_id=5&limit=3&daterange=2010-01-01T00:00:00,2020-12-31T23:59:59&flags=AllOK&sampling=monthly&statistics=avgdma8epax,dma8eu&quantiles=0.25,0.5,0.75)
<br>**Result:** {"task_id":"24666af1-5a51-4223-b8fc-c7d2d5f0070e","status":"https://toar-data.fz-juelich.de/api/v2/analysis/status/24666af1-5a51-4223-b8fc-c7d2d5f0070e"}
<br><br>To retrieve the result send a request to the status endpoint with your task identifier. If the result is there you will be redirected. The result will be a zip archive containing files in the format you have chosen.