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/v1/<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.

NameTypeDescriptionRemarks
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/v1/test/metadata/categories?key=secret

This should return a JSON response that looks similar to:

{
	"categories":[
		{
		"id":999008,
		"name":".",
		"count":0
		},
		{
		"id":21156,
		"name":"AbattoirMachinery&amp;Equipment",
		"count":40
		},
		{
		"id":23698,
		"name":"Abattoirs",
		"count":162
		}
	],
	"code":200,
	"date":"2014-09-04T11:29:19.038+1000",
	"time":524,
	"message":"Ok"
}

 

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/v1/test/metadata/categoryGroups?key=secret

This should return a JSON response that looks similar to:

{
	"groups":[
			{
				"id":328260,
				"name":"Adult&amp;EscortServices",
				"categories":[
							49121
					    ],
				"children":[
					{
						"id":865359,
						"name":"AdultEntertainment",
						"categories":[
						49604,
						47341,
						47368,
						49028
						]
					},
					{
						"id":865361,
						"name":"Escorts",
						"categories":[
						43419,
						45748,
						18058
						]
					}
				]
			},
			{
				"id":889600,
				"name":"Appliances&amp;Electronics",
				"categories":[
					27812,
					10502,
					35955,
					23272,
					43222,
					45187,
					28622,
					30759,
					45888,
					18236,
					17752
					],
				"children":[
						....
					]
			}
		],
	"code":200,
	"date":"2014-09-04T11:32:52.152+1000",
	"time":364,
	"message":"Ok"
}

Please note: It is also possible for a child category group to have its own children.

{  
   "groups":[  
      {  
         "id":392753,
         "name":"Agriculture, Fisheries & Forestry",
         "categories":[  

         ],
         "children":[  
            {  
               "id":392754,
               "name":"Agriculture",
               "categories":[  
                  10316,
                  49391,
                  37664,
                  21954
               ],
               "children":[  
                  {  
                     "id":393299,
                     "name":"Animal Production",
                     "categories":[  
                        26786,
                        42714,
                        18120,
                        35513,
                        21377,
                        11959,
                        44032,
                        43826,
                        40835,
                        29408,
                        40169,
                        15725,
                        15970,
                        38733,
                        26166,
                        22144,
                        41254,
                        40150
                     ],
                     "children":[  
                        {  
                           "id":393565,
                           "name":"Bees",
                           "categories":[  
                              43117,
                              11703,
                              18376
                           ]
                        },
                        {  
                           "id":394094,
                           "name":"Poultry & Eggs",
                           "categories":[  
                              22284,
                              12173,
                              26131
                           ]
                        },
                        {  
                           "id":393975,
                           "name":"Wool",
                           "categories":[  
                              28908,
                              33987,
                              29653,
                              23949,
                              33146
                           ]
                        }
                     ]
                  },
                  {  
                     "id":392894,
                     "name":"Crop Production",
                     "categories":[  
                        18635,
                        25054,
                        27650
                     ]
                  },
                  {  
                     "id":394226,
                     "name":"Equipment & Supplies - Agriculture",
                     "categories":[  
                        33901,
                        37591,
                        44121,
                        37710,
                        16756,
                        10820
                     ]
                  },
                  {  
                     "id":393050,
                     "name":"Farmers & Growers",
                     "categories":[  
                        10529,
                        35823,
                        43877
                     ],
                     "children":[  
                        {  
                           "id":393106,
                           "name":"Fruit & Vegetables",
                           "categories":[  
                              36811,
                              40800,
                              24538,
                              45071,
                              11584,
                              37532,
                              21555
                           ]
                        }
                     ]
                  },
                  {  
                     "id":392755,
                     "name":"Rural Services",
                     "categories":[  
                        18457,
                        24872,
                        29890
                     ]
                  }
               ]
            },
            {  
               "id":395222,
               "name":"Fisheries",
               "categories":[  
                  37168,
                  37184,
                  11045,
                  37516,
                  26948,
                  26638
               ]
            },
            {  
               "id":395653,
               "name":"Forestry",
               "categories":[  
                  36129
               ],
               "children":[  
                  {  
                     "id":395670,
                     "name":"Sawmilling & Logging ",
                     "categories":[  
                        28657,
                        20192,
                        37834
                     ]
                  }
               ]
            }
         ]
      },
      {  
         "id":889600,
         "name":"Appliances & Electronics",
         "categories":[  
            27812,
            10502,
            35955,
            23272,
            43222,
            45187,
            28622,
            30759,
            45888,
            18236,
            17752
         ],
         "children":[  
            {  
               "id":444812,
               "name":"Electrical Appliances",
               "categories":[  
                  37087,
                  15806,
                  23787
               ]
            },
            {  
               "id":444539,
               "name":"Home Appliances & Whitegoods",
               "categories":[  
                  14109,
                  28339,
                  14117,
                  37990,
                  41165,
                  21628,
                  27200,
                  32247,
                  12327,
                  12548,
                  16055,
                  17833,
                  10103
               ],
               "children":[  
                  {  
                     "id":446889,
                     "name":"Vacuum Cleaners",
                     "categories":[  
                        18422,
                        16152,
                        12920
                     ]
                  },
                  {  
                     "id":447331,
                     "name":"Washing Machines & Dryers",
                     "categories":[  
                        17515,
                        30937,
                        32484
                     ]
                  }
               ]
            },
            {  
               "id":341048,
               "name":"Televisions",
               "categories":[  
                  43133,
                  27308,
                  33057,
                  25976,
                  17418,
                  12599
               ]
            },
            {  
               "id":342044,
               "name":"Video & DVD",
               "categories":[  
                  38997,
                  42145
               ],
               "children":[  
                  {  
                     "id":342181,
                     "name":"Video & DVD Equipment",
                     "categories":[  
                        22632,
                        44628,
                        41211,