Downloading seasonality data

Hi! Is there a way to download the number of observations for a species by month or phenology? I’m interested in creating a document of the most common invasive plant species of the mid-Atlantic United States and when people frequently see them. See attached image for an example. I want to be able to do this quickly and not have to manually enter each species. Thanks!

You can get that info from the API via GET /observations/histogram.

Example:

curl https://api.inaturalist.org/v1/observations/histogram?taxon_name=Acer%20platanoides&interval=month_of_year

Results:

{
  "results": {
    "month_of_year": {
      "1": 265,
      "2": 303,
      "3": 708,
      "4": 7164,
      "5": 12184,
      "6": 6587,
      "7": 5301,
      "8": 4812,
      "9": 6781,
      "10": 6202,
      "11": 2727,
      "12": 410
    }
  },
  "total_results": 12,
  "page": 1,
  "per_page": 12
}
2 Likes

To narrow that down by phenology, it’s a little less straightforward since you need to refer to annotations and values by ID instead of by label. You can get those IDs from the GET /controlled_terms endpoint. Here are the relevant parts:

{
  "id": 12,
  "label": "Plant Phenology",
  "taxon_ids": [
    47126
  ],
  "values": [
    {
      "id": 13,
      "label": "Flowering"
    },
    {
      "id": 14,
      "label": "Fruiting"
    },
    {
      "id": 15,
      "label": "Flower Budding"
    },
    {
      "id": 21,
      "label": "No Evidence of Flowering"
    }
  ]
}

Then plug those values into the term_id and term_value_id fields for the histogram endpoint. For example, getting observation counts of Acer platanoides by month for “Plant Phenology: Fruiting” would be:

curl https://api.inaturalist.org/v1/observations/histogram?taxon_name=Acer%20platanoides&interval=month_of_year&term_id=12&term_value_id=14

Results:

{
  "results": {
    "month_of_year": {
      "1": 2,
      "2": 2,
      "3": 3,
      "4": 16,
      "5": 125,
      "6": 117,
      "7": 71,
      "8": 73,
      "9": 62,
      "10": 36,
      "11": 9,
      "12": 3
    }
  },
  "total_results": 12,
  "page": 1,
  "per_page": 12
}
1 Like

if you need basically same the information that shows up on the taxon page seasonality graphs, you can get this from the API via /v1/observations/popular_field_values. it’s a little more efficient than getting that information /v1/observations/histogram, although /histogram will allow you to specify a few more options when retrieving data. see https://forum.inaturalist.org/t/plant-phenology-graph-data/31862/2 for more information.

1 Like