Open annikaLiving opened 3 years ago
There is a green button available to consumers when looking at resources stored in the datastore.
Need to determine the value of this and if it should be re-introduced.
In Cat Classic popup contains
CKAN Data API Access resource data via a web API with powerful query support. Further information in the main CKAN Data API and DataStore documentation.
Endpoints
The Data API can be accessed via the following actions of the CKAN action API.
Querying
Query example (first 5 results) https://catalogue.data.gov.bc.ca/api/3/action/datastore_search?resource_id=8f341d11-9966-4e1e-bffb-cb0d61fb10fd&limit=5
Query example (results containing 'jones') https://catalogue.data.gov.bc.ca/api/3/action/datastore_search?resource_id=8f341d11-9966-4e1e-bffb-cb0d61fb10fd&q=jones
Query example (via SQL statement) https://catalogue.data.gov.bc.ca/api/3/action/datastore_search_sql?sql=SELECT * from "8f341d11-9966-4e1e-bffb-cb0d61fb10fd" WHERE title LIKE 'jones'
Example Java Script:
A simple ajax (JSONP) request to the data API using jQuery.
var data = { resource_id: '8f341d11-9966-4e1e-bffb-cb0d61fb10fd', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://catalogue.data.gov.bc.ca/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
Example Python
import urllib url = 'https://catalogue.data.gov.bc.ca/api/3/action/datastore_search?resource_id=8f341d11-9966-4e1e-bffb-cb0d61fb10fd&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()
Feds' catalogue is a bit different
Example of one of our records they have scraped: https://open.canada.ca/data/en/dataset/f8e27889-fb07-4f9d-b2ba-591578274b7c
They also show the link to the package API etc on their package page
Metadata: Link to JSON format DCAT (JSON-LD) DCAT (XML)
https://dpdd.atlassian.net/browse/DDS-1133
There is a green button available to consumers when looking at resources stored in the datastore.
Need to determine the value of this and if it should be re-introduced.
In Cat Classic popup contains
CKAN Data API Access resource data via a web API with powerful query support. Further information in the main CKAN Data API and DataStore documentation.
Endpoints
The Data API can be accessed via the following actions of the CKAN action API.
Querying
Query example (first 5 results) https://catalogue.data.gov.bc.ca/api/3/action/datastore_search?resource_id=8f341d11-9966-4e1e-bffb-cb0d61fb10fd&limit=5
Query example (results containing 'jones') https://catalogue.data.gov.bc.ca/api/3/action/datastore_search?resource_id=8f341d11-9966-4e1e-bffb-cb0d61fb10fd&q=jones
Query example (via SQL statement) https://catalogue.data.gov.bc.ca/api/3/action/datastore_search_sql?sql=SELECT * from "8f341d11-9966-4e1e-bffb-cb0d61fb10fd" WHERE title LIKE 'jones'
Example Java Script:
A simple ajax (JSONP) request to the data API using jQuery.
var data = { resource_id: '8f341d11-9966-4e1e-bffb-cb0d61fb10fd', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://catalogue.data.gov.bc.ca/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
Example Python
import urllib url = 'https://catalogue.data.gov.bc.ca/api/3/action/datastore_search?resource_id=8f341d11-9966-4e1e-bffb-cb0d61fb10fd&limit=5&q=title:jones'
fileobj = urllib.urlopen(url) print fileobj.read()
Feds' catalogue is a bit different
Example of one of our records they have scraped: https://open.canada.ca/data/en/dataset/f8e27889-fb07-4f9d-b2ba-591578274b7c
They also show the link to the package API etc on their package page
Metadata: Link to JSON format DCAT (JSON-LD) DCAT (XML)