EUROCORE data portal: public API
Brief documentation
1. Get an individual data object by record ID
Main syntax: https://api.eurocore.rocks/$table/$id[.xml | .json | .jsonp | .api]
Examples:
https://api.eurocore.rocks/drillcore/1
https://api.eurocore.rocks/drillcore/1.json
https://api.eurocore.rocks/sample/775
https://api.eurocore.rocks/analysis/3620
2. Search and/or get a list of records
Main syntax: https://api.eurocore.rocks/$table
Optional parameters:
to specify output format: ?format=json|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,...
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.eurocore.rocks/drillcore
https://api.eurocore.rocks/analysis/?format=json&fields=id,drillcore__name,depth,analysis_method__method&drillcore__name__icontains=kylylahti
https://api.eurocore.rocks/drillcore/?name__istartswith=kyly
https://api.eurocore.rocks/analysis_result/?parameter__parameter=Au&value__gt=3
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
OR search, different fields, different values: ?or_search=$field1:$value1;$field2:$value2;$field3:$value3
https://api.eurocore.rocks/analysis_summary/?or_search=au_ppm__gt:3;ag_ppm__gt:2&fields=drillcore_name,depth,au_ppm,ag_ppm&order_by=drillcore_name,-depth&format=json
3. List of tables and fields that can currently be accessed