ebird-client-0.2.0.1: Client functions for querying the eBird API.
Copyright(c) 2023 Finley McIlwaine
LicenseMIT (see LICENSE)
MaintainerFinley McIlwaine <finleymcilwaine@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.EBird.Client.Generated

Description

Client functions generated using servant-client. The queries here match exactly the schemas defined in ebird-api, and are therefore potentially a bit more clunky to use. See the wrappers in Client for more convenient options.

Synopsis

Generated eBird API client functions

Generated directly from the definition of the API in ebird-api.

Observations queries

recentObservations_ Source #

Arguments

:: Text

eBird API key

-> RegionCode

Region(s) to get observations from

-> Maybe Integer

How many days back to look for observations

1 - 30, default: 14

-> Maybe TaxonomyCategories

Only include observations in these taxonomy categories

default: all categories

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Bool

Include observations which have not been reviewed

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe RegionCode

Up to 10 extra regions to get observations from

default: none

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [Observation 'Simple] 

Get a list of recent observations within a region. Results only include the most recent observation for each species in the region.

See the eBird API documentation for the corresponding endpoint.

recentNotableObservations_ Source #

Arguments

:: Text

eBird API key

-> RegionCode

Region(s) to get observations from

-> Maybe Integer

How many days back to look for observations

1 - 30, default: 14

-> Maybe DetailLevel

Detail level for the resulting observations

default: Simple

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe RegionCode

Up to 10 extra regions to get observations from

default: none

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [SomeObservation] 

Get a list of recent notable observations within a region. Results only include the most recent observation for each species in the region.

See the eBird API documentation for the corresponding endpoint.

recentSpeciesObservations_ Source #

Arguments

:: Text

eBird API key

-> RegionCode

Region(s) to get observations from

-> SpeciesCode

Species to get observations of (e.g. "barswa" for Barn Swallow)

-> Maybe Integer

How many days back to look for observations

1 - 30, default: 14

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Bool

Include observations which have not been reviewed

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe RegionCode

Up to 10 extra regions to get observations from

default: none

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [Observation 'Simple] 

Get a list of recent observations of a specific species within a region.

See the eBird API documentation for the corresponding endpoint.

recentNearbyObservations_ Source #

Arguments

:: Text

eBird API key

-> Double

Latitude of the location to get observations near

-> Double

Longitude of the location to get observations near

-> Maybe Integer

Search radius from the given latitude/longitude in kilometers

0 - 50, default: 25

-> Maybe Integer

How many days back to look for observations

1 - 30, default: 14

-> Maybe TaxonomyCategories

Only include observations in these taxonomy categories

default: all

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Bool

Include observations which have not been reviewed

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe SortObservationsBy

Sort observations by taxonomy (SortObservationsBySpecies) or by date (SortObservationsByDate, most recent first)

default: SortObservationsByDate

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [Observation 'Simple] 

Get a list of recent observations within some radius of some latitude/longitude.

See the eBird API documentation for the corresponding endpoint.

recentNearbySpeciesObservations_ Source #

Arguments

:: Text

eBird API key

-> SpeciesCode

Species to get observations of (e.g. "bohwax" for Bohemian Waxwing)

-> Double

Latitude of the location to get observations near

-> Double

Longitude of the location to get observations near

-> Maybe Integer

Search radius from the given latitude/longitude in kilometers

0 - 50, default: 25

-> Maybe Integer

How many days back to look for observations

1 - 30, default: 14

-> Maybe TaxonomyCategories

Only include observations in these taxonomy categories

default: all

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Bool

Include observations which have not been reviewed

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe SortObservationsBy

Sort observations by taxonomy (SortObservationsBySpecies) or by date (SortObservationsByDate, most recent first)

default: SortObservationsByDate

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [Observation 'Simple] 

Get a list of recent observations of a species within some radius of some latitude/longitude.

See the eBird API documentation for the corresponding endpoint.

recentNearestSpeciesObservations_ Source #

Arguments

:: Text

eBird API key

-> SpeciesCode

Species to get observations of

-> Double

Latitude of the location to get observations near

-> Double

Longitude of the location to get observations near

-> Maybe Integer

Search radius from the given latitude/longitude in kilometers

0 - 50, default: 25

-> Maybe Integer

How many days back to look for observations

0 - 30, default: 14

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Bool

Include observations which have not been reviewed

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [Observation 'Simple] 

Get a list of recent observations of some species nearest to some latitude/longitude.

See the eBird API documentation for the corresponding endpoint.

recentNearbyNotableObservations_ Source #

Arguments

:: Text

eBird API key

-> Double

Latitude of the location to get observations near

-> Double

Longitude of the location to get observations near

-> Maybe Integer

Search radius from the given latitude/longitude in kilometers

0 - 50, default: 25

-> Maybe DetailLevel

Detail level for the resulting observations

default: Simple

-> Maybe Integer

How many days back to look for observations

0 - 30, default: 14

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [SomeObservation] 

Get a list of recent notable observations of some near some latitude/longitude.

See the eBird API documentation for the corresponding endpoint.

historicalObservations_ Source #

Arguments

:: Text

eBird API key

-> RegionCode

Region(s) to get observation from

-> Integer

Year, from 1800 to present

-> Integer

Month (1 - 12)

-> Integer

Day in the month

-> Maybe TaxonomyCategories

Only include observations in these taxonomy categories

default: all

-> Maybe DetailLevel

Detail level for the resulting observations

default: Simple

-> Maybe Bool

Only get observations from hotspots

default: False

-> Maybe Bool

Include observations which have not been reviewed

default: False

-> Maybe Integer

Maximum number of observations to get

1 - 10000, default: all

-> Maybe SelectObservation

Whether to display the first or last observation of a species on the date, in the case that there are multiple observations of the same species on the date

default: SelectLastObservation

-> Maybe RegionCode

Up to 50 extra regions to get observations from

default: none

-> Maybe SPPLocale

Return observations with common names in this locale

default: En

-> ClientM [SomeObservation] 

Get a list of observations for each species seen on a specific date. The specific observations returned are determined by the SelectObservation parameter - first observation of the species (SelectFirstObservation) or last observation (SelectLastObservation, default).

See the eBird API documentation for the corresponding endpoint.

Product queries

recentChecklists_ Source #

Arguments

:: Text

eBird API key

-> RegionCode

Region(s) to get checklists from

-> Maybe Integer

Maximum number of checklists to fetch

1 - 200, default: 10

-> ClientM [ChecklistFeedEntry] 

Get a list recently submitted checklists within a region.

See the eBird API documentation for the corresponding endpoint.

top100_ Source #

Arguments

:: Text

eBird API key

-> Region

Region to fetch the ranking for

-> Integer

Year, from 1800 to present

-> Integer

Month (1 - 12)

-> Integer

Day in the month

-> Maybe RankTop100By

Rank the resulting list by number of species observed or by number of checklists completed

default: RankTop100BySpecies

-> Maybe Integer

Maximum number of entries to fetch

1 - 100, default: 100

-> ClientM [Top100ListEntry] 

Get a list of top contributors for a region on a specific date, ranked by number of species observed or number of checklists submitted.

See the eBird API documentation for the corresponding endpoint.

checklistFeed_ Source #

Arguments

:: Text

eBird API key

-> Region

Region to fetch the checklist feed for

-> Integer

Year, from 1800 to present

-> Integer

Month (1 - 12)

-> Integer

Day in the month

-> Maybe SortChecklistsBy

Sort the resulting list by date of checklist submission or date of checklist creation

default: SortChecklistsByDateCreated

-> Maybe Integer

Maximum number of checklists to fetch

1 - 200, default: 10

-> ClientM [ChecklistFeedEntry] 

Get a list of checklists submitted within a region on a specific date.

See the eBird API documentation for the corresponding endpoint.

regionalStatistics_ Source #

Arguments

:: Text

eBird API key

-> Region

Region to fetch the statistics for

-> Integer

Year, from 1800 to present

-> Integer

Month (1 - 12)

-> Integer

Day in the month

-> ClientM RegionalStatistics 

Get the RegionalStatistics for a region on a specific date.

See the eBird API documentation for the corresponding endpoint.

speciesList_ Source #

Arguments

:: Text

eBird API key

-> Region

Region to fetch the species list for

-> ClientM [SpeciesCode] 

Get a list of all species ever seen in a region.

See the eBird API documentation for the corresponding endpoint.

viewChecklist_ Source #

Arguments

:: Text

eBird API key

-> Text

Checklist submission ID, e.g. "S144646447"

-> ClientM Checklist 

Get information about a checklist.

See the eBird API documentation for the corresponding endpoint.

Hotspot queries

regionHotspots_ Source #

Arguments

:: RegionCode

Region(s) to get hotspots in

-> Maybe Integer

Only fetch hotspots that have been visited within this many days ago

1 - 30, default: no limit

-> Maybe CSVOrJSONFormat

Format results in CSV or JSON format

NOTE: This argument should always be hardcoded to JSONFormat, even though the default is CSVFormat. It is only here for to be consistent with the eBird API. Unfortunately, the endpoint for this query switches content types based on this query parameter instead of an "Accept" header. That means servant is unable to determine whether the result will be CSV or JSON encoded. For now, the workaround is to always hardcode this to JSONFormat.

default: CSVFormat

-> ClientM [Hotspot] 

Get all hotspots in a list of one or more regions (RegionCode).

See the eBird API documentation for the corresponding endpoint.

NOTE: The eBird API is broken. Always hardcode the CSVOrJSONFormat argument to JSONFormat.

nearbyHotspots_ Source #

Arguments

:: Double

Latitude of the location to get hotspots near

-> Double

Longitude of the location to get hotspots near

-> Maybe Integer

Only fetch hotspots that have been visited within this many days ago

1 - 30, default: no limit

-> Maybe Integer

Search radius in kilometers

0 - 50, default: 25

-> Maybe CSVOrJSONFormat

Format results in CSV or JSON format

NOTE: This argument should always be hardcoded to JSONFormat, even though the default is CSVFormat. It is only here for to be consistent with the eBird API. Unfortunately, the endpoint for this query switches content types based on this query parameter instead of an "Accept" header. That means servant is unable to determine whether the result will be CSV or JSON encoded. For now, the workaround is to always hardcode this to JSONFormat.

default: CSVFormat

-> ClientM [Hotspot] 

Get all hotspots within a radius of some latitude/longitude.

See the eBird API documentation for the corresponding endpoint.

NOTE: The eBird API is broken. Always hardcode the CSVOrJSONFormat argument to JSONFormat.

hotspotInfo_ Source #

Arguments

:: Text

Location ID of the hotspot (e.g. "L2373040")

-> ClientM LocationData 

Get information about a hotspot.

See the eBird API documentation for the corresponding endpoint.

Taxonomy queries

taxonomy_ Source #

Arguments

:: Maybe TaxonomyCategories

Only include species of these TaxonomyCategorys in the taxonomy

default: all categories

-> Maybe CSVOrJSONFormat

Format the taxonomy in CSV or JSON

NOTE: This argument should always be hardcoded to JSONFormat, even though the default is CSVFormat. It is only here for to be consistent with the eBird API. Unfortunately, the endpoint for this query switches content types based on this query parameter instead of an "Accept" header. That means servant is unable to determine whether the result will be CSV or JSON encoded. For now, the workaround is to always hardcode this to JSONFormat.

default: CSVFormat

-> Maybe SPPLocale

Use this locale for common names

default: En

-> Maybe SpeciesCodes

Only fetch records for these species

default: all

-> Maybe Text

Fetch this version of the eBird taxonomy

default: latest

-> ClientM [Taxon] 

Get any version of the eBird taxonomy, with optional filtering based on taxonomy categories and species.

See the eBird API documentation for the corresponding endpoint.

NOTE: The eBird API is broken. Always hardcode the CSVOrJSONFormat argument to JSONFormat.

taxonomicForms_ Source #

Arguments

:: Text

eBird API key

-> SpeciesCode

Species to get the sub species of

-> ClientM SpeciesCodes 

Get the list of sub species of a given species recognized in the eBird taxonomy.

See the eBird API documentation for the corresponding endpoint.

taxaLocaleCodes_ Source #

Arguments

:: Text

eBird API key

-> Maybe SPPLocale

Value for the "Accept-Language" header, for translated language names, when available

default: En

-> ClientM [SPPLocaleListEntry] 

Get the supported locale codes and names for species common names, with the last time they were updated.

See the eBird API documentation for the corresponding endpoint.

taxonomyVersions_ :: ClientM [TaxonomyVersionListEntry] Source #

Get all versions of the taxonomy, with a flag indicating which is latest.

See the eBird API documentation for the corresponding endpoint.

taxonomicGroups_ Source #

Arguments

:: SPPGrouping

MerlinGrouping groups like birds together, with falcons next to hawks, while EBirdGrouping groups in taxonomy order

-> Maybe SPPLocale

Locale to use for species group names. En is used for any locale whose translations are unavailable at this endpoint

default: En

-> ClientM [TaxonomicGroupListEntry] 

Get the list of species groups, in either Merlin or eBird grouping.

See the eBird API documentation for the corresponding endpoint.

Region queries

regionInfo_ Source #

Arguments

:: Text

eBird API key

-> Region

Region to get information for

-> Maybe RegionNameFormat

How to format the region name in the response

default: Full

-> ClientM RegionInfo 

Get a RegionInfo for an eBird region.

See the eBird API documentation for the corresponding endpoint.

subregionList_ Source #

Arguments

:: Text

eBird API key

-> RegionType

Type of subregions to fetch

-> RegionCode

Parent RegionCode

-> ClientM [RegionListEntry] 

Get a list of subregions of a given region type within a given region. Keep in mind that many combinations of sub region and parent region are invalid, e.g. CountryType regions within "US-WY".

See the eBird API documentation for the corresponding endpoint.

adjacentRegions_ Source #

Arguments

:: Text

eBird API key

-> Region

Region to fetch the adjacent regions of

-> ClientM [RegionListEntry] 

Get a list of regions adjacent to a given region. Only Subnational2 region codes in the United States, New Zealand, or Mexico are currently supported.

See the eBird API documentation for the corresponding endpoint.