Skip to content
Branch: master
Find file History

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
img
README.md
field_examples.py
geo_search.ipynb
graphql_utils.py
requirements.txt
using_cursors.ipynb
using_graphql_intro.ipynb

README.md

GraphQL API Examples

This directory contains examples of accessing the Agrimetrics GraphQL API.

Notebook Tutorials

The Jupyter notebooks can be run locally using Jupyter lab:

$ export API_KEY=<insert API key here>
$ jupyter notebook

Then use the Jupyter interface in your browser to navigate to one of the notebooks.

Simple Example Scripts

  • field_examples.py — simple examples of accessing most of the properties of fields through the GraphQL API, with minimal explanations.
  • graphql_utils.py — a library file containing supporting functions for other examples.

The field_examples.py example does the following:

  • Get the soil information for the area specified by a custom polygon.
  • Get the soil information for the area within 3500m of the default point location.
  • Get the area, altitude and soil information for a specific field.
  • For a given field id, get all the total daily rainfall since the start of the month.
  • Get the ids of all fields that lie within a 10000m radius of the default point location.
$ export API_KEY=<insert API key here>
$ python field_examples.py
You can’t perform that action at this time.