Skip to content

Commit

Permalink
Note query time limit
Browse files Browse the repository at this point in the history
  • Loading branch information
rickybassom committed Jan 2, 2024
1 parent 0a3f69d commit 12fa9ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/rest_api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# GMN REST API

The GMN REST API provides an interface to query and retrieve meteor trajectory data by constructing read-only SQL queries on the GMN Data Store database.
The GMN REST API provides an interface to query and retrieve meteor trajectory data by constructing read-only SQL queries on the [GMN Data Store](https://explore.globalmeteornetwork.org/gmn_data_store) database.

We use [Datasette](https://docs.datasette.io/en/0.64.6/json_api.html) to provide the REST API.

## HTTP GET Requests

Expand All @@ -27,6 +29,8 @@ You can use this when making subsequent requests to the endpoint to ensure you a

Queries are cached for 1 hour with a maximum size of 1GB on the server. The cache is invalidated if the GMN Data Store database has been modified by our data ingestion processes which usually run twice a day.

Queries are blocked if they take longer than 3 seconds to execute. I recommend using [EXPLAIN QUERY PLAN](https://www.sqlite.org/eqp.html) to check the query execution plan before running a query. If you need to run a long-running query, please contact us.

### The Meteor Summary REST API Endpoint

The Meteor Summary REST API Endpoint allows you to retrieve meteor properties from the GMN Data Store in a combined format. The properties available are described here:
Expand Down Expand Up @@ -59,6 +63,8 @@ The final page of results will include no data.

Queries are cached for 1 hour with a maximum size of 1GB on the server. The cache is invalidated if the GMN Data Store database has been modified by our data ingestion processes.

Queries are blocked if they take longer than 3 seconds to execute. I recommend using [EXPLAIN QUERY PLAN](https://www.sqlite.org/eqp.html) to check the query execution plan before running a query. If you need to run a long-running query, please contact us.

### Examples

#### Get the number of stations in the network
Expand Down
2 changes: 1 addition & 1 deletion src/gmn_python_api/gmn_rest_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
This module contains functions to read data from the GMN REST API.
The REST API uses the Datasette API endpoint. More info:
https://gmn-python-api.readthedocs.io/en/0.64.6/rest_api.html
https://gmn-python-api.readthedocs.io/en/latest/rest_api.html
"""

import json
Expand Down

0 comments on commit 12fa9ea

Please sign in to comment.