Access this resource programmatically through the CKAN DataStore API
Get 5 results containing "jones" in any field:
curl https://dev.emuasa.secmotic.com/en/api/action/datastore_search \
-H"Authorization:$API_TOKEN" -d '
{
"resource_id": "b2fcdb92-e524-431a-b3ae-9188200c1109",
"limit": 5,
"q": "jones"
}'
const resp = await fetch(`https://dev.emuasa.secmotic.com/en/api/action/datastore_search`, {
method: 'POST',
headers: {
'content-type': 'application/json',
authorization: API_TOKEN
},
body: JSON.stringify({
resource_id: 'b2fcdb92-e524-431a-b3ae-9188200c1109',
limit: 5,
q: 'jones'
})
})
await resp.json()
(using the ckanapi client library)
from ckanapi import RemoteCKAN
rc = RemoteCKAN('https://dev.emuasa.secmotic.com/en/', apikey=API_TOKEN)
result = rc.action.datastore_search(
resource_id="b2fcdb92-e524-431a-b3ae-9188200c1109",
limit=5,
q="jones",
)
print(result['records'])Filter by multiple values:
curl https://dev.emuasa.secmotic.com/en/api/action/datastore_search \
-H"Authorization:$API_TOKEN" -d '
{
"resource_id": "b2fcdb92-e524-431a-b3ae-9188200c1109",
"filters": {
"subject": ["watershed", "survey"],
"stage": "active"
}
}'
const resp = await fetch(`https://dev.emuasa.secmotic.com/en/api/action/datastore_search`, {
method: 'POST',
headers: {
'content-type': 'application/json',
authorization: API_TOKEN
},
body: JSON.stringify({resource_id: 'b2fcdb92-e524-431a-b3ae-9188200c1109', filters: {
subject: ['watershed', 'survey'],
stage: 'active'
}})})
await resp.json()
from ckanapi import RemoteCKAN
rc = RemoteCKAN('https://dev.emuasa.secmotic.com/en/', apikey=API_TOKEN)
result = rc.action.datastore_search(
resource_id="b2fcdb92-e524-431a-b3ae-9188200c1109",
filters={
"subject": ["watershed", "survey"],
"stage": "active",
},
)
print(result['records'])
Some API endpoints are accessible via a URL with GET parameters.
Query example (first 5 results)
Query example (results containing "jones")