Documentation ¶
Index ¶
- Constants
- type AdjacentRegions
- type Bounds
- type ChecklistFeedOnDate
- type Client
- func (c *Client) AdjacentRegions(ctx context.Context, regionCode string, opts ...RequestOption) ([]AdjacentRegions, error)
- func (c *Client) ChecklistFeedOnDate(ctx context.Context, regionCode string, y, m, d int, opts ...RequestOption) ([]ChecklistFeedOnDate, error)
- func (c *Client) EbirdTaxonomy(ctx context.Context, opts ...RequestOption) ([]EbirdTaxonomy, error)
- func (c *Client) HistoricObservationsOnDate(ctx context.Context, regionCode string, y, m, d int, opts ...RequestOption) ([]Observations, error)
- func (c *Client) HotspotInfo(ctx context.Context, locId string, opts ...RequestOption) (*HotspotInfo, error)
- func (c *Client) HotspotsInRegion(ctx context.Context, regionCode string, opts ...RequestOption) ([]HotspotsInRegion, error)
- func (c *Client) NearbyHotspots(ctx context.Context, opts ...RequestOption) ([]NearbyHotspots, error)
- func (c *Client) NearestObservationsOfSpecies(ctx context.Context, speciesCode string, opts ...RequestOption) ([]Observations, error)
- func (c *Client) RecentChecklistsFeed(ctx context.Context, regionCode string, opts ...RequestOption) ([]RecentChecklistsFeed, error)
- func (c *Client) RecentNearbyNotableObservations(ctx context.Context, opts ...RequestOption) ([]Observations, error)
- func (c *Client) RecentNearbyObservations(ctx context.Context, opts ...RequestOption) ([]Observations, error)
- func (c *Client) RecentNearbyObservationsOfSpecies(ctx context.Context, speciesCode string, opts ...RequestOption) ([]Observations, error)
- func (c *Client) RecentNotableObservationsInRegion(ctx context.Context, regionCode string, opts ...RequestOption) ([]Observations, error)
- func (c *Client) RecentObservationsInRegion(ctx context.Context, regionCode string, opts ...RequestOption) ([]Observations, error)
- func (c *Client) RecentObservationsOfSpeciesInRegion(ctx context.Context, regionCode, speciesCode string, opts ...RequestOption) ([]Observations, error)
- func (c *Client) RegionInfo(ctx context.Context, regionCode string, opts ...RequestOption) (*RegionInfo, error)
- func (c *Client) RegionalStatisticsOnDate(ctx context.Context, regionCode string, y, m, d int, opts ...RequestOption) (*RegionalStatisticsOnDate, error)
- func (c *Client) SpeciesListForRegion(ctx context.Context, regionCode string, opts ...RequestOption) ([]string, error)
- func (c *Client) SubRegionList(ctx context.Context, regionType, parentRegionCode string, ...) ([]SubRegionList, error)
- func (c *Client) TaxaLocaleCodes(ctx context.Context, opts ...RequestOption) ([]TaxaLocaleCodes, error)
- func (c *Client) TaxonomicForms(ctx context.Context, speciesCode string, opts ...RequestOption) ([]string, error)
- func (c *Client) TaxonomicGroups(ctx context.Context, speciesGrouping string, opts ...RequestOption) ([]TaxonomicGroups, error)
- func (c *Client) TaxonomyVersions(ctx context.Context, opts ...RequestOption) ([]TaxonomyVersions, error)
- func (c *Client) Top100(ctx context.Context, regionCode string, y, m, d int, opts ...RequestOption) ([]Top100, error)
- func (c *Client) ViewChecklist(ctx context.Context, subId string, opts ...RequestOption) (*ViewChecklist, error)
- type ClientOption
- type EbirdTaxonomy
- type Error
- type HotspotInfo
- type HotspotsInRegion
- type Loc
- type NearbyHotspots
- type Obs
- type Observations
- type RecentChecklistsFeed
- type RegionInfo
- type RegionalStatisticsOnDate
- type RequestOption
- func Back(amount int) RequestOption
- func Cat(code string) RequestOption
- func Delim(code string) RequestOption
- func Dist(amount int) RequestOption
- func Fmt(code string) RequestOption
- func GroupNameLocale(code string) RequestOption
- func Hotspot(code bool) RequestOption
- func IncludeProvisional(code bool) RequestOption
- func Lat(amount int) RequestOption
- func Lng(amount int) RequestOption
- func Locale(code string) RequestOption
- func MaxResults(amount int) RequestOption
- func R(code string) RequestOption
- func RankedBy(code string) RequestOption
- func RegionNameFormat(code string) RequestOption
- func SortKey(code string) RequestOption
- func Species(code string) RequestOption
- func SppLocale(code string) RequestOption
- func Version(code string) RequestOption
- type SubAux
- type SubRegionList
- type TaxaLocaleCodes
- type TaxonomicGroups
- type TaxonomyVersions
- type Top100
- type ViewChecklist
Constants ¶
const ( // Base URL for eBird API 2.0 requests. // baseURL should always be specified with a trailing slash. APIEndpointBase = "https://api.ebird.org/v2/" // The data/obs end-points are used to fetch observations submitted to eBird in checklists. // https://documenter.getpostman.com/view/664302/S1ENwy59#4e020bc2-fc67-4fb6-a926-570cedefcc34 APIEndpointHistoricObservationsOnDate = "data/obs/%s/historic/%d/%d/%d" APIEndpointNearestObservationsOfSpecies = "data/nearest/geo/recent/%s" APIEndpointRecentChecklistsFeed = "product/lists/%s" APIEndpointRecentNearbyNotableObservations = "data/obs/geo/recent/notable" APIEndpointRecentNearbyObservations = "data/obs/geo/recent" APIEndpointRecentNearbyObservationsOfSpecies = "data/obs/geo/recent/%s" APIEndpointRecentNotableObservationsInRegion = "data/obs/%s/recent/notable" APIEndpointRecentObservationsInRegion = "data/obs/%s/recent" APIEndpointRecentObservationsOfSpeciesInRegion = "data/obs/%s/recent/%s" // The product end-points make it easy to get the information shown in various pages on the eBird web site // https://documenter.getpostman.com/view/664302/S1ENwy59#af04604f-e406-4cea-991c-a9baef24cd78 APIEndpointChecklistFeedOnDate = "product/lists/%s/%d/%d/%d" APIEndpointRegionalStatisticsOnDate = "product/stats/%s/%d/%d/%d" APIEndpointSpeciesListForRegion = "product/spplist/%s" APIEndpointTop100 = "product/top100/%s/%d/%d/%d" APIEndpointViewChecklist = "product/checklist/view/%s" // ref/geo // With the ref/geo end-point you can find a country's or region's neighbours. // https://documenter.getpostman.com/view/664302/S1ENwy59#c9947c5c-2dce-4c6d-9911-7d702235506c APIEndpointAdjacentRegions = "ref/adjacent/%s" // ref/hotspot // With the ref/hotspot end-points you can find the hotspots for a given country or region or nearby hotspots // https://documenter.getpostman.com/view/664302/S1ENwy59#c9947c5c-2dce-4c6d-9911-7d702235506c APIEndpointHotspotInfo = "ref/hotspot/info/%s" APIEndpointHotspotsInRegion = "ref/hotspot/%s" APIEndpointNearbyHotspots = "ref/hotspot/geo" // ref/taxonomy // https://documenter.getpostman.com/view/664302/S1ENwy59#36c95b76-e18e-4788-9c9e-e539045f9166 APIEndpointEbirdTaxonomy = "ref/taxonomy/ebird" APIEndpointTaxaLocaleCodes = "ref/taxa-locales/ebird" APIEndpointTaxonomicForms = "ref/taxon/forms/%s" APIEndpointTaxonomicGroups = "ref/sppgroup/%s" APIEndpointTaxonomyVersions = "ref/taxonomy/versions" // ref/region // The ref/region end-points return information on regions. // https://documenter.getpostman.com/view/664302/S1ENwy59#e18ea3b5-e80c-479f-87db-220ce8d9f3b6 APIEndointRegionInfo = "ref/region/info/%s" APIEndointSubRegionInfo = "ref/region/list/%s/%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdjacentRegions ¶
type ChecklistFeedOnDate ¶
type ChecklistFeedOnDate struct { LocId string `json:"locId,omitempty"` SubId string `json:"subId,omitempty"` UserDisplayName string `json:"userDisplayName,omitempty"` NumSpecies int32 `json:"numSpecies,omitempty"` ObsDt string `json:"obsDt,omitempty"` ObsTime string `json:"obsTime,omitempty"` IsoObsDate string `json:"isoObsDate,omitempty"` SubID string `json:"subID,omitempty"` Loc HotspotInfo `json:"loc,omitempty"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AdjacentRegions ¶
func (c *Client) AdjacentRegions(ctx context.Context, regionCode string, opts ...RequestOption) ([]AdjacentRegions, error)
func (*Client) ChecklistFeedOnDate ¶
func (c *Client) ChecklistFeedOnDate(ctx context.Context, regionCode string, y, m, d int, opts ...RequestOption) ([]ChecklistFeedOnDate, error)
func (*Client) EbirdTaxonomy ¶
func (c *Client) EbirdTaxonomy(ctx context.Context, opts ...RequestOption) ([]EbirdTaxonomy, error)
func (*Client) HistoricObservationsOnDate ¶
func (c *Client) HistoricObservationsOnDate(ctx context.Context, regionCode string, y, m, d int, opts ...RequestOption) ([]Observations, error)
func (*Client) HotspotInfo ¶
func (c *Client) HotspotInfo(ctx context.Context, locId string, opts ...RequestOption) (*HotspotInfo, error)
func (*Client) HotspotsInRegion ¶
func (c *Client) HotspotsInRegion(ctx context.Context, regionCode string, opts ...RequestOption) ([]HotspotsInRegion, error)
func (*Client) NearbyHotspots ¶
func (c *Client) NearbyHotspots(ctx context.Context, opts ...RequestOption) ([]NearbyHotspots, error)
func (*Client) NearestObservationsOfSpecies ¶
func (c *Client) NearestObservationsOfSpecies(ctx context.Context, speciesCode string, opts ...RequestOption) ([]Observations, error)
func (*Client) RecentChecklistsFeed ¶
func (c *Client) RecentChecklistsFeed(ctx context.Context, regionCode string, opts ...RequestOption) ([]RecentChecklistsFeed, error)
func (*Client) RecentNearbyNotableObservations ¶
func (c *Client) RecentNearbyNotableObservations(ctx context.Context, opts ...RequestOption) ([]Observations, error)
func (*Client) RecentNearbyObservations ¶
func (c *Client) RecentNearbyObservations(ctx context.Context, opts ...RequestOption) ([]Observations, error)
func (*Client) RecentNearbyObservationsOfSpecies ¶
func (c *Client) RecentNearbyObservationsOfSpecies(ctx context.Context, speciesCode string, opts ...RequestOption) ([]Observations, error)
func (*Client) RecentNotableObservationsInRegion ¶
func (c *Client) RecentNotableObservationsInRegion(ctx context.Context, regionCode string, opts ...RequestOption) ([]Observations, error)
func (*Client) RecentObservationsInRegion ¶
func (c *Client) RecentObservationsInRegion(ctx context.Context, regionCode string, opts ...RequestOption) ([]Observations, error)
func (*Client) RecentObservationsOfSpeciesInRegion ¶
func (c *Client) RecentObservationsOfSpeciesInRegion(ctx context.Context, regionCode, speciesCode string, opts ...RequestOption) ([]Observations, error)
func (*Client) RegionInfo ¶
func (c *Client) RegionInfo(ctx context.Context, regionCode string, opts ...RequestOption) (*RegionInfo, error)
func (*Client) RegionalStatisticsOnDate ¶
func (c *Client) RegionalStatisticsOnDate(ctx context.Context, regionCode string, y, m, d int, opts ...RequestOption) (*RegionalStatisticsOnDate, error)
func (*Client) SpeciesListForRegion ¶
func (*Client) SubRegionList ¶
func (c *Client) SubRegionList(ctx context.Context, regionType, parentRegionCode string, opts ...RequestOption) ([]SubRegionList, error)
func (*Client) TaxaLocaleCodes ¶
func (c *Client) TaxaLocaleCodes(ctx context.Context, opts ...RequestOption) ([]TaxaLocaleCodes, error)
func (*Client) TaxonomicForms ¶
func (*Client) TaxonomicGroups ¶
func (c *Client) TaxonomicGroups(ctx context.Context, speciesGrouping string, opts ...RequestOption) ([]TaxonomicGroups, error)
func (*Client) TaxonomyVersions ¶
func (c *Client) TaxonomyVersions(ctx context.Context, opts ...RequestOption) ([]TaxonomyVersions, error)
func (*Client) ViewChecklist ¶
func (c *Client) ViewChecklist(ctx context.Context, subId string, opts ...RequestOption) (*ViewChecklist, error)
type ClientOption ¶
type ClientOption func(client *Client)
func WithAcceptLanguage ¶
func WithAcceptLanguage(lang string) ClientOption
func WithBaseURL ¶
func WithBaseURL(urlStr string) ClientOption
type EbirdTaxonomy ¶
type EbirdTaxonomy struct { SciName string `json:"sciName,omitempty"` ComName string `json:"comName,omitempty"` SpeciesCode string `json:"speciesCode,omitempty"` Category string `json:"category,omitempty"` TaxonOrder float32 `json:"taxonOrder,omitempty"` BandingCodes []string `json:"bandingCodes,omitempty"` ComNameCodes []string `json:"comNameCodes,omitempty"` SciNameCodes []string `json:"sciNameCodes,omitempty"` Order string `json:"order,omitempty"` FamilyCode string `json:"familyCode,omitempty"` FamilyComName string `json:"familyComName,omitempty"` FamilySciName string `json:"familySciName,omitempty"` }
type HotspotInfo ¶
type HotspotInfo struct { LocId string `json:"locId,omitempty"` Name string `json:"name,omitempty"` Latitude float32 `json:"latitude,omitempty"` Longitude float32 `json:"longitude,omitempty"` CountryCode string `json:"countryCode,omitempty"` CountryName string `json:"countryName,omitempty"` Subnational1Name string `json:"subnational1Name,omitempty"` Subnational1Code string `json:"subnational1Code,omitempty"` Subnational2Code string `json:"Subnational2Code,omitempty"` Subnational2Name string `json:"Subnational2Name,omitempty"` IsHotspot bool `json:"isHotspot,omitempty"` LocID string `json:"locID,omitempty"` LocName string `json:"locName,omitempty"` Lat float32 `json:"lat,omitempty"` Lng float32 `json:"lng,omitempty"` HierarchicalName string `json:"hierarchicalName,omitempty"` }
type HotspotsInRegion ¶
type HotspotsInRegion struct { LocId string `json:"locId,omitempty"` LocName string `json:"locName,omitempty"` CountryCode string `json:"countryCode,omitempty"` Subnational1Code string `json:"subnational1Code,omitempty"` Subnational2Code string `json:"subnational2Code,omitempty"` Lat float32 `json:"lat,omitempty"` Lng float32 `json:"lng,omitempty"` LatestObsDt string `json:"latestObsDt,omitempty"` NumSpeciesAllTime int32 `json:"numSpeciesAllTime,omitempty"` }
type Loc ¶
type Loc struct { LocId string `json:"locId,omitempty"` Name string `json:"name,omitempty"` Latitude float32 `json:"latitude,omitempty"` Longitude float32 `json:"longitude,omitempty"` CountryCode string `json:"countryCode,omitempty"` CountryName string `json:"countryName,omitempty"` Subnational1Name string `json:"subnational1Name,omitempty"` Subnational1Code string `json:"subnational1Code,omitempty"` Subnational2Code string `json:"Subnational2Code,omitempty"` Subnational2Name string `json:"Subnational2Name,omitempty"` IsHotspot bool `json:"isHotspot,omitempty"` LocName string `json:"locName,omitempty"` Lat float32 `json:"lat,omitempty"` Lng float32 `json:"lng,omitempty"` HierarchicalName string `json:"hierarchicalName,omitempty"` LocID string `json:"locID,omitempty"` }
type NearbyHotspots ¶
type NearbyHotspots struct { LocId string `json:"locId,omitempty"` LocName string `json:"locName,omitempty"` CountryCode string `json:"countryCode,omitempty"` Subnational1Code string `json:"subnational1Code,omitempty"` Lat float32 `json:"lat" validate:"required"` Lng float32 `json:"lng" validate:"required"` LatestObsDt string `json:"latestObsDt,omitempty"` NumSpeciesAllTime int32 `json:"numSpeciesAllTime,omitempty"` }
type Obs ¶
type Obs struct { SpeciesCode string `json:"speciesCode,omitempty"` HideFlags []string `json:"hideFlags,omitempty"` ObsDt string `json:"obsDt,omitempty"` Subnational1Code string `json:"subnational1Code,omitempty"` HowManyAtleast int32 `json:"howManyAtleast,omitempty"` HowManyAtmost int32 `json:"howManyAtmost,omitempty"` SubId string `json:"subId,omitempty"` ProjId string `json:"projId,omitempty"` ObsId string `json:"obsId,omitempty"` HowManyStr string `json:"howManyStr,omitempty"` Present bool `json:"present,omitempty"` }
type Observations ¶
type Observations struct { SpeciesCode string `json:"speciesCode,omitempty"` ComName string `json:"comName,omitempty"` SciName string `json:"sciName,omitempty"` LocId string `json:"locId,omitempty"` LocName string `json:"locName,omitempty"` ObsDt string `json:"obsDt,omitempty"` HowMany int32 `json:"howMany,omitempty"` Lat float32 `json:"lat,omitempty"` Lng float32 `json:"lng,omitempty"` ObsValid bool `json:"obsValid,omitempty"` ObsReviewed bool `json:"obsReviewed,omitempty"` LocationPrivate bool `json:"locationPrivate,omitempty"` SubId string `json:"subId,omitempty"` ExoticCategory string `json:"exoticCategory,omitempty"` }
type RecentChecklistsFeed ¶
type RecentChecklistsFeed struct { LocId string `json:"locId,omitempty"` SubId string `json:"subId,omitempty"` UserDisplayName string `json:"userDisplayName,omitempty"` NumSpecies int32 `json:"numSpecies,omitempty"` ObsDt string `json:"obsDt,omitempty"` ObsTime string `json:"obsTime,omitempty"` IsoObsDate string `json:"isoObsDate,omitempty"` SubID string `json:"subID,omitempty"` Loc Loc `json:"loc,omitempty"` }
type RegionInfo ¶
type RequestOption ¶
type RequestOption func(*requestOptions)
func Back ¶
func Back(amount int) RequestOption
Only fetch hotspots which have been visited up to 'back' days ago. Values: 1-30
func Cat ¶
func Cat(code string) RequestOption
Only fetch records from these taxonomic categories. Values: any available category, must be lowercase
func Delim ¶
func Delim(code string) RequestOption
The characters used to separate elements in the name. Values: (any characters)
func Dist ¶
func Dist(amount int) RequestOption
The search radius from the given position, in kilometers. Values: 0 - 500
func Fmt ¶
func Fmt(code string) RequestOption
Fetch the records in CSV or JSON format. Values: csv, json
func GroupNameLocale ¶
func GroupNameLocale(code string) RequestOption
Locale for species group names. English names are returned for any non-listed locale or any non-translated group name Values: bg,cs,da,de,en,es,es_AR,es_CL,es_CU,es_ES,es_MX,es_PA,fr,he, is,nl,no,pt_BR,pt_PT,ru,sr,th,tr, or zh
func Hotspot ¶
func Hotspot(code bool) RequestOption
Only fetch observations from hotspots. Values: true, false
func IncludeProvisional ¶
func IncludeProvisional(code bool) RequestOption
Include observations which have not yet been reviewed. Values: true, false
func Lat ¶
func Lat(amount int) RequestOption
Required. Latitude to 2 decimal places. Values: -90 - 90
func Lng ¶
func Lng(amount int) RequestOption
Required. Longitude to 2 decimal places. Values: -180 - 180
func Locale ¶
func Locale(code string) RequestOption
Use this language for common names. Values: any available locale
func MaxResults ¶
func MaxResults(amount int) RequestOption
Only fetch this number of contributors. Values: 1 - 100
func R ¶
func R(code string) RequestOption
Fetch observations from up to 10 locations. Values: any location code
func RankedBy ¶
func RankedBy(code string) RequestOption
Order by number of complete checklists (cl) or by number of species seen (spp). Values: spp, cl
func RegionNameFormat ¶
func RegionNameFormat(code string) RequestOption
Control how the name is displayed. Values: detailed, detailednoqual, full, namequal, nameonly, revdetailed
func SortKey ¶
func SortKey(code string) RequestOption
Order the results by the date of the checklist or by the date it was submitted. Values: obs_dt, creation_dt
func Species ¶
func Species(code string) RequestOption
Only fetch records for these species. Values: any species code
func SppLocale ¶
func SppLocale(code string) RequestOption
Use this language for species common names. Values: any available locale
func Version ¶
func Version(code string) RequestOption
Fetch a specific version of the taxonomy. any available version
type SubRegionList ¶
type TaxaLocaleCodes ¶
type TaxonomicGroups ¶
type TaxonomyVersions ¶
type Top100 ¶
type Top100 struct { ProfileHandle string `json:"profileHandle,omitempty"` UserDisplayName string `json:"userDisplayName,omitempty"` NumSpecies int32 `json:"numSpecies,omitempty"` NumCompleteChecklists int32 `json:"numCompleteChecklists,omitempty"` RowNum int32 `json:"rowNum,omitempty"` UserId string `json:"userId,omitempty"` }
type ViewChecklist ¶
type ViewChecklist struct { ProjId string `json:"projId,omitempty"` SubId string `json:"subId,omitempty"` ProtocolId string `json:"protocolId,omitempty"` LocId string `json:"locId,omitempty"` GroupId string `json:"groupId,omitempty"` DurationHrs float32 `json:"durationHrs,omitempty"` AllObsReported bool `json:"allObsReported,omitempty"` CreationDt string `json:"creationDt,omitempty"` LastEditedDt string `json:"lastEditedDt,omitempty"` ObsDt string `json:"obsDt,omitempty"` ObsTimeValid bool `json:"obsTimeValid,omitempty"` ChecklistId string `json:"checklistId,omitempty"` NumObservers int32 `json:"numObservers,omitempty"` EffortDistanceKm float32 `json:"effortDistanceKm,omitempty"` EffortDistanceEnteredUnit string `json:"effortDistanceEnteredUnit,omitempty"` Subnational1Code string `json:"subnational1Code,omitempty"` SubmissionMethodCode string `json:"submissionMethodCode,omitempty"` SubmissionMethodVersion string `json:"submissionMethodVersion,omitempty"` UserDisplayName string `json:"userDisplayName,omitempty"` NumSpecies int32 `json:"numSpecies,omitempty"` SubmissionMethodVersionDisp string `json:"submissionMethodVersionDisp,omitempty"` SubAux []SubAux SubAuxAi []string `json:"subAuxAi,omitempty"` Obs []Obs }