API

Tips and other helpful information on using the API is outlined below. This section will be regularly updated.

Search

The search API can be found at: /Api/Search

Additionally, a single data provider (e.g. Experian) can be appended to the url /Api/Search/Experian. This will only return one result for this provider. Otherwise all provider results are returned

Filter parameters are passed on the querystring. Where multiple parameters of the same type are allowed, these will be treated with an OR clause. For parameters of different types, these are treated with an AND clause.

For example, a search of postcode districts EH10, EH11 as well as SIC Code 1234 will generate a filter of ((EH10 OR EH11) AND 1234)

Possible parameters

  • town: Town. Autocomplete lookups available via /Autocomplete/Town.
  • county: County (can be used to qualify town). Autocomplete lookups available via /Autocomplete/County.
  • sic92Code: Code according to SIC92. Autocomplete lookups across the SIC 92 descriptions available via /Autocomplete/SIC92Code.
  • sic2007Code: Division according to SIC2007. Autocomplete lookups across the SIC 2007 descriptions available via /Autocomplete/SIC2007Code.
  • ypCode: Classification according to Yellow Pages. Autocomplete lookups across the YP Classification descriptions available via /Autocomplete/YPCode.
  • ypSector: Sector according to Yellow Pages. Autocomplete lookups across the YP Sector descriptions available via /Autocomplete/YPSector. Multiple values allowed.
  • employeesAtSiteBand: Number of emplyees at site (bands A-G and U for unclassified). Autocomplete lookups available via /Autocomplete/EmployeesAtSiteBand.
  • jobTitle: Job title/role. Autocomplete lookups available via /Autocomplete/JobTitle.
  • principalContactOnly: Job title/role. Autocomplete lookups available via /Autocomplete/JobTitle.
  • postcode: Used in conjunction with radius.  Provides a search centred on the longitude and latitude of the postcode.  If no radius is specified this defaults to 10km
  • radius:  Radius in km around the specified postcode

Search Result

The search result contains the date generated, and details of the count in each provider

<SearchResults xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DateCreated>2009-07-09T15:56:59.6256726+01:00</DateCreated>
<ProviderResults>
<SearchResult>
<Name>Experian</Name>
<Count>1973629</Count>
<Id>00000000-0000-0000-0000-000000000000</Id>
</SearchResult>
</ProviderResults>
</SearchResults>

Download

The download API can be found at: /Api/Download

The following parameters are all required when submitting a download request:

  • search: The search id that was returned in the search result for which the data is required
  • package: The name of the package for the download (e.g. BASIC)
  • reseller: The id of the reseller
  • password: The reseller password

The resulting download format depends on the package requested

NOTE: For the prototype a secured zip archive is generated.

Autocomplete

A number of api calls are available to retrieve lookup information for the various parameters. This guarantees that valid values will be submitted back to the search.

All urls accept a querystring parameter 'q' with the partial text. No querystring returns all values

All calls return a string containing text/value pairs ('|' delimited) separated by new lines

For example, YPSector

Printing|IY
Drink|EH
Food Products - General|EK
Office Equipment|AN
Measuring and Control Instruments|IQ
...

API Autocomplete urls are: