bcn.query_resource
bcn_query_resourceQuery rows from an active Open Data BCN DataStore resource using JSON filters. Returns a bounded page of results.
Instructions
Query rows from an active Open Data BCN CKAN DataStore resource. Call bcn_get_resource_info first when possible and use returned field IDs. Pass filters as a JSON object, not raw SQL or URL query fragments. This always uses POST JSON to datastore_search and returns a bounded page with explicit truncation. If the resource is not DataStore-active, use bcn_preview_resource for a bounded CSV/JSON download preview.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | ||
| sort | No | ||
| limit | No | Rows to return. Server maximum: 100. | |
| fields | No | ||
| offset | No | ||
| filters | No | ||
| resource_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| error | No | ||
| provenance | Yes |