Skip to content

agrimetrics/api-examples

Repository files navigation

Agrimetrics API Examples

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:

Python scripts

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

R Notebooks

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

Example directories

This repository has four main directories of examples and tutorials.

CropLens AI Examples

Notebook demonstrating how to use Agrimetrics GraphQL API to obtain crop predictions.

Field Explorer Examples

Examples of how to use Python to access Agrimetrics' REST APIs. These provide weather, crop and soil information attributed to individual fields.

Geospatial Workflow Examples

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.

GraphQL Examples

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).

SAR Examples

A notebook demonstrating how to train a crop growth model to SAR data.

Verde Examples

Examples and tutorials of how to use Agrimetrics' GraphQL API to access Airbus Crop Analytics data (previously known as Verde). This is our premium data set containing crop measurements derived from satellite observations of the UK.

Further Reading

  • 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’s bundler, it is similar in spirit to those tools.
  • Jupyter lab

About

Repository of sample scripts with which one consumes data from Agrimetrics' Data Platform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages