This repository contains some examples of how to call Agrimetrics' APIs. Some examples have been developed in Python and others in R.
Pre-requisites:
- Python 3.6+
- a valid Field Explorer subscription key must be obtained and set in your environment as
API_KEY
. - Jupyter Lab (R 3.6.3+)
To obtain your subscription key:
- Sign-up to Agrimetrics via either the Developer Portal or the Field Explorer Demo.
- Subscribe to Field Explorer by pressing 'Subscribe' in the Field Explorer Product page
To setup your python environment, install the dependencies using the requirements.txt
file found in each subdirectory:
$ pip install -r requirements.txt
Alternatively, you can use pipenv
:
$ pipenv install
The notebooks can be run within a Jupyter Notebook server; this can be a server run locally (within a docker container or native) or in the cloud.
Running locally within your native operating system:
$ jupyter notebook
This repository has four main directories of examples and tutorials.
Examples of how to use Python to access Agrimetrics' REST APIs. These provide weather, crop and soil information attributed to individual fields.
Notebooks demonstrating how to use Agrimetrics' GraphQL API using R. The examples demonstrate how to access static and timeseries geospatial datasets available through the API.
Examples and tutorials of how to use Agrimetrics' GraphQL API. This API provides access to all of our queryable data, including premium data such as field boundaries and satellite observations of fields (Verde data -- see below).
A notebook demonstrating how to train a crop growth model to SAR data.
Examples and tutorials of how to use Agrimetrics' GraphQL API to access Verde data. This is our premium data set containing crop measurements derived from satellite observations of the UK.
- Agrimetrics Developer Portal - full API documentation
- GeoJSON - GeoJSON specification
- JSON-LD - JSON-LD specification
- Pandas - Python Data Analysis Library used by these examples
- matplotlib - Python 2D plotting library used by these examples
- GraphQL - GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.
- pipenv - Pipenv is a dependency manager for Python projects. If you’re familiar with Node.js’
npm
or Ruby’sbundler
, it is similar in spirit to those tools. - Jupyter lab