Estonian geocollections information system public API
Brief documentation
1. Get an individual data object by record ID
Main syntax: https://api.geocollections.info/$table/$id[.xml | .json | .jsonp | .api]
Examples:
https://api.geocollections.info/locality/10230
https://api.geocollections.info/locality/10230.json
https://api.geocollections.info/sample/77508
https://api.geocollections.info/taxon/4085
https://api.geocollections.info/stratigraphy/123
2. Search and/or get a list of records
Main syntax: https://api.geocollections.info/$table
Optional parameters:
to specify output format: ?format=json|xml|jsonp|api (If not specified, default format is api)
to specify page: ?page=$page
to specify the number of records per page: ?paginate_by=$paginate_by (page limits are specified in List of Tables below. If not specified, limit is 1000 records)
to specify list of fields to retrieve: ?fields=$field1,$field2,...
to specify search criteria: ?$field__$lookuptype=$search_string (where $lookuptype is one of: exact, iexact, in, range, contains, icontains, startswith, istartswith, endswith, iendswith, gt, lt, gte, lte, isnull, hierarchy. If omitted is equivalent to __exact)
to display related data: ?related_data=$table&fields=$field1,$field2,... (only available for single object requests by record ID)
to make hierarchical search: ?$field__hierarchy=$value or ?$field__$lookuptype__hierarchy=$value (only for tables 'taxon', 'classification', 'classification_rock' and 'stratigraphy')
to order results by a field: ?order_by=$field (ascending) or ?order_by=-$field (descending)
to group results by a field: ?group_by=$field
to exclude records by some criteria: ?$field!=$value
to exclude null values: ?$field__isnull!=True or ?$field__isnull=False or ?$field!=null
Examples:
https://api.geocollections.info/taxon
https://api.geocollections.info/taxon?page=10
https://api.geocollections.info/taxon/?format=json&?fields=taxon,id&taxon__istartswith=Asaphus
https://api.geocollections.info/sample/?number__istartswith=OM6
https://api.geocollections.info/analysis_results/?name__exact=U [ppm]&value__gt=100
https://api.geocollections.info/reference/?author__icontains=nõlvak, j
https://api.geocollections.info/locality/21104?fields=locality,id&related_data=drillcore&related_data=locality_reference&fields=reference__reference
https://api.geocollections.info/taxon/?format=json&fields=id,taxon,author_year&taxon__istartswith__hierarchy=Prot
OR search:
OR search, one value from multiple fields: ?multi_search=value:$value;fields:$field1,$field2,$field3;lookuptype:$lookuptype
To exclude values: value:!$value
Lookuptype parameter can be omitted, is equivalent to exact
Multiple multi_search query strings can be added
Example:
https://api.geocollections.info/specimen/?format=json&fields=id&multi_search=value:pirgu;fields:stratigraphy__stratigraphy,stratigraphy__stratigraphy_en;lookuptype:icontains&multi_search=value:orjak;fields:locality__country__value,locality__country__value_en,locality__vald__vald,locality__maakond__maakond,locality__asustusyksus__asustusyksus,locality__locality,locality__locality_en;lookuptype:icontains
OR search, different fields, different values: ?or_search=$field1:$value1;$field2:$value2;$field3:$value3
https://api.geocollections.info/locality/?format=json&or_search=country__value:Läti;vald__vald__icontains:ants
3. List of tables and fields that can currently be accessed