SARV API

Estonian geocollections information system: public API

Brief documentation

1. Get an individual data object by record ID

Main syntax: https://api2.geokogud.info/$table/$id[.xml | .json | .jsonp | .api]

Examples:

  • https://api2.geokogud.info/locality/10230
  • https://api2.geokogud.info/locality/10230.json
  • https://api2.geokogud.info/sample/77508
  • https://api2.geokogud.info/taxon/4085
  • https://api2.geokogud.info/stratigraphy/123


  • 2. Search and/or get a list of records

    Main syntax: https://api2-test.geokogud.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)
  • 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
  • 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://api2.geokogud.info/taxon
  • https://api2.geokogud.info/taxon?page=10
  • https://api2.geokogud.info/taxon/?format=json&?fields=taxon,id&taxon__istartswith=Asaphus
  • https://api2.geokogud.info/sample/?number__istartswith=OM6
  • https://api2.geokogud.info/analysis_results/?name__exact=U [ppm]&value__gt=100
  • https://api2.geokogud.info/reference/?author__icontains=nõlvak, j
  • https://api2.geokogud.info/locality/21104?fields=locality,id&related_data=drillcore&related_data=reference&fields=author,year
  • https://api2.geokogud.info/taxon/?format=json&fields=id,taxon,author_year&taxon__istartswith__hierarchy=Prot


  • 3. List of tables and fields that can currently be accessed