Metadata
The Metadata endpoint provides information about listing reference data. The different types of data available via this endpoint are listed below.
Usage
http://api.sensis.com.au/ob-20110511/<env>/metadata/<dataType>?key=<key>
where env is the id of the environment to send the request to. Can be either test or prod.
Parameters
The Metadata endpoint takes the following parameters:
| Name | Type | Description | Remarks |
|---|---|---|---|
dataType |
string | The type of metadata (required) | Currently this can be either categories or categoryGroups |
key |
string | API key (required) |
See Authenticating for details. |
Response Message
HTTP content type: application/json
The response message is a JSON object containing the following members.
| Name | Type | Description | Remarks |
|---|---|---|---|
categories |
array | Returned from categories metadata. |
Array containing categories used by Sensis. |
categoryGroups |
array | Returned from categoryGroups metadata. |
Array containing categoryGroups as defined by Sensis. |
time |
number | Time taken to process the request. | Reported in milliseconds. |
code |
number | Response code. | Indicates success or failure of the API call. |
The /metadata/categories endpoint also reveals a list of all categories and the associated listing count for each category.
Result
HTTP Status
The Metadata endpoint will always return HTTP 200 on success. See HTTP Status Codes for possible error codes.
Example - Categories
Categories are used to help classify different business listings into logical groups. To fetch a list of all the Search API categories and assuming your API key was secret:
http://api.sensis.com.au/ob-20110511/test/metadata/categories?key=secret
This should return a JSON response that looks similar to:
{
"categories": [
{
"name": "Abattoir Machinery & Equipment",
"id": 21156
},
{
"name": "Abattoirs",
"id": 23698
},
...
{
"name": "Zoos, Sanctuaries & Animal Parks",
"id": 22195
}
],
"time": 31,
"code": 200
}
Example - Category Groups
Category Groups are a way to help classify different categories into logical groups. To fetch a list of all the Search API category groups and assuming your API key was secret:
http://api.sensis.com.au/ob-20110511/test/metadata/categoryGroups?key=secret
This should return a JSON response that looks similar to:
{
"groups": [
{
"name":"Adult & Escort",
"children": [
{
"name":"Adult Entertainment",
"categories": [
47341,
47368,
49028
]
},
{
"name":"Escorts",
"categories": [
43419,
45748,
18058
]
}
],
"categories": [
49121
]
},
...
{
"name":"Travel & Tourism"
"children": [
...
],
"categories": [
...
]
}
"time": 1639,
"code": 200
}
Please note: It is also possible for a child category group to have its own children.
Docs Navigation
- Documentation Overview
- Getting Started
- Using Endpoints
- Technologies
- Authenticating
- Limits
- Common Fields
- Status Codes and Messages
- Validation Errors
- Searching
- Pagination
- Sorting
- Spell Checker
- Search Query Tips
- Reporting Usage Events
- Filtering Unsafe Content
- Category Filtering
- Postcode Filtering
- Radius Filtering
- Address Search
- Suburb Filtering
- State Filtering
- Bounding Box Filtering
- Filtering by Content Type
- Filtering by Product Keyword
- Location Tier Filtering
- Examples
- Endpoint Reference
- Reference
- Troubleshooting
Yellow Pages
White Pages
Whereis
Citysearch
About Sensis
Bigpond
Telstra