Search API
Perform a free-text search against the text fields indexed in a dataset. Useful when you want to quickly query a dataset but don't know, or need to know its structure. There is also a solr search endpoint allowing more complex queries.
Table of contents
Endpoint URL
Login to test this query using our experimental API explorer
Authentication
You will need your API key (on your dashboard) in order to authenticate to this API. You have two options for authentication:
- By URL Parameter -- add the
apikeyparameter to your request URL, with your key as the value - By Request Header -- add a custom HTTP header called
X_KASABI_APIKEYto your HTTP request, with your key as the value
For more information on Kasabi authentication options read the authentication documentation. Your API key will need to be authorized to use this service.
Parameters
Search API requests vary depending on whether the client is performing a keyword search or a solr search. This functionality is exposed from two sub-paths:
/search- Perform a keyword standard search./search/solr- Perform a search using solr query syntax.
Request parameters vary depending on whether a standard search or a solr query is being performed. These are outlined below.
Keyword Search Parameters
The parameters for a keyword search (/search) are as follows:
| Parameter Name | Parameter Value(s) | Required? | Notes |
|---|---|---|---|
query | Any valid search query. | Yes | |
max | Positive integer, up to a maximum of 100 | No | Specify maximum number of results to be returned. The default is 10, and there is a fixed maximum of 100 results for a single page. |
offset | Positive integer | No | Specify an offset into search results. Use with max to implement paging. |
sort | Deprecated | Deprecated | Deprecated |
output | json or xml | No | Supports selecting response format using url parameter rather than HTTP Accept header. |
Facet Parameters
The parameters for a basic solr search (/search/solr) are as follows:
| Parameter Name | Parameter Value(s) | Required? | Notes |
|---|---|---|---|
q | Any valid solr search query. | Yes | Read the solr search documentation for details. |
wt | json or xml | No | Supports selecting response format using url parameter rather than HTTP Accept header. |
HTTP Response Codes
Clients should be prepared to receive any valid HTTP response code. The following table lists the most frequently used codes
| Code | Meaning |
|---|---|
200 OK | Successful Request |
400 Bad Request | Missing or malformed SPARQL query |
401 Not Authorized | API key is not authorized to access the data |
Please also review our additional notes on response codes.
Response Formats
The Search API response formats vary depending on whether a text search or a solr query is being performed. However both support XML and JSON
Keyword Search Formats
See the standard search documentation for examples.
The response formats for a keyword search (/search) are as follows:
| Response Format | Accept header | output parameter | Notes |
|---|---|---|---|
| application/json | - | json | Return results serialized as JSON |
| application/xml | application/xml | xml | Return results serialized as XML |
Solr Formats
The structure of the results are not the same as the /search API. See the solr search documentation for examples.
The response formats for a solr search (/search/solr) are as follows:
| Response Format | Accept header | wt parameter | Notes |
|---|---|---|---|
| application/json | - | json | Return results serialized as JSON |
| application/xml | application/xml | xml | Return results serialized as XML |