Bookmark page
Send to a Friend
Print this page
Features:
Competitive pricing
No set-up Charges
Over 99.99% Availability
Free Trial Software
Free Technical Support
Try before you buy
Local or Internet
Reseller Opportunities
    Postcode finder using data supplied by royal mail
Updated Daily

Postcode Programming API  Simply Postcode Software HTTP/XML Web Service:


Simply Postcode Lookup XML/ HTTP Web service offers a simple way to interact with our postcode address lookup service. A simple web request URL returns XML which can be read by almost any programming language.   This service provides up to date Royal mail address information, that is updated daily.

This data source can be used by any web server or programming language that supports a server-side scripting language that can parse XML data, to provide Postcode Software Lookup and Nearest Store locator within your software/Web site.

The service is available across a simple HTTP protocol. Each request is a standard HTTP GET request with the query string forming the request parameters, and returns the address Lookup information as XML.

video  Tutorial Video : Explain HTTP/XML Web Service

video  Full Online API Reference Manual : HTTP/XML Web Service


HTTP/XML Web Service Features:


The HTTP/XML Web Service has the following features:

  • Platform/Language independent
  • Offers full access to all data we provide (Full/Thoroughfare/Geographic Longitude and Latitude)
  • Data always up to date
  • No Data Administration Cost for you
  • Can allow your customer to open an account, you get commission

HTTP/XML Web Service Example Code


The HTTP/XML examples:

HTTPExample.exe can be found in the root of the example download code. This demonstrates the HTTP requests in action.

Turning on “Show calls in detail to Demonstrate HTTP/XML Data” will show the URLs called and the XML returned by calls HTTP calls. This should help programmers of other languages understand the HTTP calls and returns data.

For Web Sites

DirectoryLanguageAPI UsedDescription
AJAX/AJAX ASP Full AddressASPHTTP/XMLAJAX Full Address example
AJAX/AJAX ASP Full Address 2 AddressesASPHTTP/XMLAJAX Full Address example with 2 address box on same page
AJAX/AJAX ASP NET Full AddressASP.NETHTTP/XMLAJAX Full Address example
AJAX/AJAX ASP NET Full Address 2 AddressesASP.NETHTTP/XMLAJAX Full Address example with 2 address box on same page
AJAX/AJAX ASP NET Full Address 2 Addresses C#C#HTTP/XMLAJAX Full Address example
AJAX/AJAX ASP NET Full Address C#C#HTTP/XMLAJAX Full Address example with 2 address box on same page
AJAX/AJAX ASP NET ThoroughfareASP.NETHTTP/XMLAJAX Thoroughfare/Street Address example
AJAX/AJAX ASP NET Thoroughfare 2 AddressesASP.NETHTTP/XMLAJAX Thoroughfare/Street Address example with 2 address box on same page
AJAX/AJAX ASP NET Thoroughfare 2 Addresses C#C#HTTP/XMLAJAX Thoroughfare/Street Address example with 2 address box on same page
AJAX/AJAX ASP NET Thoroughfare C#C#HTTP/XMLAJAX Thoroughfare/Street Address example
AJAX/AJAX ASP ThoroughfareASPHTTP/XMLAJAX Thoroughfare/Street Address example
AJAX/AJAX ASP Thoroughfare 2 AddressesASPHTTP/XMLAJAX Thoroughfare/Street Address example with 2 address box on same page
AJAX/AJAX PHP Full AddressPHPHTTP/XMLAJAX Full Address example
AJAX/AJAX PHP Full Address 2 AddressesPHPHTTP/XMLAJAX Full Address example with 2 address box on same page
AJAX/AJAX PHP ThoroughfarePHPHTTP/XMLAJAX Thoroughfare/Street Address example
AJAX/AJAX PHP Thoroughfare 2 AddressesPHPHTTP/XMLAJAX Thoroughfare/Street Address example with 2 address box on same page
ASPASPHTTP/XMLHow to get PostZon and Thoroughfare/Street data using HTTP/XML Web Service
PHP core code/Full Address core codePHPHTTP/XMLGet Full using HTTP/XML Web Service
PHP core code/PostZon core codePHPHTTP/XMLGet PostZon using HTTP/XML Web Service
PHP core code/Thoroughfare core codePHPHTTP/XMLGet Thoroughfare/Street using HTTP/XML Web Service
PythonPythonHTTP/XMLGet Thoroughfare/Street using HTTP/XML Web Service
JavaJavaHTTP/XMLGet Thoroughfare/Street using HTTP/XML Web Service
Web Popup/ASP Full Address Web Pop-upASPHTTP/XMLWeb Popup for full address using ASP
Web Popup/PHP Full Address Web Pop-upPHPHTTP/XMLWeb Popup for full address using ASP
Web Popup/VBNET 2005 Full Address Web PopupVB.NETHTTP/XMLWeb Popup for full address using .NET

For Desktop Software

DirectoryLanguageAPI UsedDescription
VB6 HTTP ExampleVB6HTTP/XMLExample of how to use HTTP/XML web service to get FULL, Thoroughfare/Street and PostZon Data
HTTPExample.exeDemoHTTP/XMLDemonstrates the HTTP/XML calls by showing the url called and the XML results. Should run from this directory on any PC

  Download API Examples 


Get Full Address from HTTP/XML Web Service:


To get a full address from our HTTP/XML Web Service we do the following:

Step 1 Call XMLService/XMLSearchForAddress.aspx for list of address at Postcode

Returns a series of lines, from which the user can select full royal mail address information (Royal mail PAF Database). XMLGetAddressRecord.aspx (Step 2) is then called with the selected address id, to get full address information.

Example:

Call HTTP web service with your data key, which is e-mailed to you when you open an account.  The data key identifies your account and licenses in our system.

www.simplylookupadmin.co.uk/XMLservice/XMLSearchForAddress.aspx?datakey=Your Data Key&postcode=pe132ql

   Returns
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
   <!DOCTYPE data [
   <!ELEMENT data (found, credits_display_text, accountadminpage, errormessage, addressdata)>


   <!ELEMENT found (#PCDATA)>
   <!ELEMENT credits_display_text (#PCDATA)>
   <!ELEMENT accountadminpage (#PCDATA)>
   <!ELEMENT errormessage (#PCDATA)>


   <!ELEMENT addressdata (maxresults,recordcount,records*)>
      <!ELEMENT maxresults (#PCDATA)>
      <!ELEMENT recordcount(#PCDATA)>
      <!ELEMENT records (record)>

      <!ELEMENT record (id, line)>
         <!ELEMENT id (#PCDATA)>
         <!ELEMENT line (#PCDATA)>
]>

<data>
   <found>1</found>
   <errormessage></errormessage>
   <accountadminpage>http://xxx...xxx</accountadminpage>
   <credits_display_text>1/1 users</credits_display_text>

   <addressdata>
      <maxresults>0</maxresults>
      <recordcount>2</recordcount>

      <records>
         <record>
            <id>11570840_0e</id>
            <line>44 Victoria Road Wisbech</line>
         </record>
         <record>
            <id>11570841_0e</id>
            <line>48 Victoria Road Wisbech</line>
         </record>
      </records>

   </addressdata>
</data>

If address returned then <found>=1, else <found>=0,error in <errormessage>

If used by employee of company (classed as "Internal use")

It is a requirement of the royal mail that if postcode lookup software is used by an employee of a company, then the user must be uniquely identified so we can apply a user count.

Therefore the URL must contain a User ID:

www.simplylookupadmin.co.uk/XMLservice/XMLSearchForAddress.aspx?datakey=Your Data Key&postcode=pe132ql&username=UserID

This will be the datakey beginning with "I"

Section 3.5 of the Terms and Conditions state: "The Customer, when using the Postcode Lookup service via Web Service, must make sure each user is identified by a unique Computer name, in each call to the Web Service if used internally”. In simple language this means that each user must be identified by a unique computer name, in username parameter, if used by a company employee.

Step 2 Call XMLService/XMLGetAddressRecord.aspx Get Address Record

Gets the full address information given the ID.  Now call to get the full address record information for the address line selected by user.

Example:

Call HTTP web service with your data key.

www.simplylookupadmin.co.uk/XMLservice/XMLGetAddressRecord.aspx?datakey=Your Data Key&id=11570840_0E&version=2

   Returns
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!DOCTYPE data [
   <!ELEMENT data (found,credits_ display_text, accountadminpage, errormessage, record)>

   <!ELEMENT found (#PCDATA)>
   <!ELEMENT credits_display_text (#PCDATA)>
   <!ELEMENT accountadminpage (#PCDATA)>
   <!ELEMENT errormessage (#PCDATA)>
   <!ELEMENT record (id, organisation, line1, line2, line3, town, county, postcode, country,
               rawpostcode, deliverypointsuffix,nohouseholds, smallorg, pobox, mailsortcode,
               udprn,unique, spare )>
      <!ELEMENT id (#PCDATA)>
      <!ELEMENT organisation (#PCDATA)>
      <!ELEMENT line1 (#PCDATA)>
      <!ELEMENT line2 (#PCDATA)>
      <!ELEMENT line3 (#PCDATA)>
      <!ELEMENT town (#PCDATA)>
      <!ELEMENT county (#PCDATA)>
      <!ELEMENT postcode (#PCDATA)>
      <!ELEMENT country (#PCDATA)>
      <!ELEMENT rawpostcode (#PCDATA)>
      <!ELEMENT deliverypointsuffix (#PCDATA)>
      <!ELEMENT nohouseholds (#PCDATA)>
      <!ELEMENT smallorg (#PCDATA)>
      <!ELEMENT pobox (#PCDATA)>
      <!ELEMENT mailsortcode (#PCDATA)>]>
      <!ELEMENT udprn (#PCDATA)>
      <!ELEMENT unique (#PCDATA)>
      <!ELEMENT spare (#PCDATA)>
   <data>

   <found>1</found>
   <credits_display_text>Evaluation expires 28 Jul 2010</credits_display_text>
   <accountadminpage>https:/...</accountadminpage>
   <errormessage></errormessage>

   <record>
<id>11570840_0E</id>
      <organisation>Comtek</organisation>
      <line1>44 Victoria Road</line1>
      <line2></line2>
      <line3></line3>
      <town>Wisbech</town>
      <county>Cambridgeshire</county>
      <postcode>PE13 2QL</postcode>
      <country>England</country>

      <deliverypointsuffix>2N</deliverypointsuffix>
      <nohouseholds>1</nohouseholds>
      <smallorg>N</smallorg>
      <pobox></pobox>
      <rawpostcode>PE132QL</rawpostcode>
      <mailsortcode>18962</mailsortcode>
      <udprn>19147292</udprn>
      <unique>44</unique>
      <spare>44,,Victoria Road</spare>
   </record>
</data>

If address returned then <found>=1, else <found>=0,error in <errormessage>

video  Full Online API Reference Manual : HTTP/XML Web Service


Get Full Address using Advanced/Word Search:


The HTTP/XML Web Service also supports our advanced/word search when used for Internal Use. This allows the user to enter partial address words to find the full address in the Royal Mail Postcode Address file.

The principle, of searching, is very similar to the Full Address Postcode Finder described in section above.  Except it has more parameters.

Extra Parameters for Advanced Search:

To perform an advanced search, two of the following fields should be filled in with criteria

  One or more of the following:

Parameter nameDescription
organistaionEnter most distinctive word of Organisation name. Start of words can be entered by using *
For example “StartOfWord*”
buildingornumberEnter most distinctive word of Building Name or number. Start of words can be entered by using *
For example “StartOfWord*”
streetEnter most distinctive word of Street/Road or Avenue Name. Start of words can be entered by using *
For example “StartOfWord*”

  And one of the following from a selection list:

Parameter nameDescription
townorvillageTown or village name selected from a list
countyCounty name selected from a list
postareaStart of Postcode (Outer Postcode) selected from a list

The XML list of TownOrVillage, County, and Postcode Outer can be downloaded from URL:

  http://www.simplylookupadmin.co.uk/XMLService/GetLookups.aspx?datatype=1

This list should be written to a local store, and displayed for user to select from.

video  Tutorial Video : Show Advanced Search in Action

  Note: Only the first 100 lines of advanced search results are returned. In which case the criteria should be refined.

  This type of search is only available to “Internal use” type of license

Example

www.simplylookupadmin.co.uk/XMLservice/XMLSearchForAddress.aspx?datakey=Your Data Key &organistaion=Tesco&buildingornumber=&street=&townorvillage=&county=Cambridgeshire&pobox=&postarea=

   Returns
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
   <!DOCTYPE data [
   <!ELEMENT data(found,credits_ display_text, accountadminpage,
                                     errormessage,maxresults,recordcount,addressdata)>
   <!ELEMENT found (#PCDATA)>
   <!ELEMENT credits_display_text (#PCDATA)>
   <!ELEMENT accountadminpage (#PCDATA)>
   <!ELEMENT errormessage (#PCDATA)>
   <!ELEMENT maxresults (#PCDATA)>
   <!ELEMENT recordcount (#PCDATA)>
   <!ELEMENT addressdata (record*)>
   <!ELEMENT record (l,id)>
   <!ELEMENT l (#PCDATA)>
   <!ELEMENT id (#PCDATA)>
]>
<data>
   <found>1</found>
   <credits_display_text>Evaluation till 3 Apr 2011</credits_display_text>
   <accountadminpage>https://www.simplylookupadmin.co.uk/WebAccountLogin.aspx?
                        doid=1&amp;coid=3333305462&amp;Pay=yes</accountadminpage>
   <errormessage></errormessage>
   <maxresults>99</maxresults>
   <recordcount>4</recordcount>
   <addressdata>
      <record><l>Tesco Barford Road St. Neots Cambridgeshire PE19 2SA England</l>
               <id>31567757_2957290S_F</id></record>
      <record><l>Tesco 2-10 Staniland Way Peterborough Cambridgeshire PE4 6NA England</l>
               <id>29530895_1945471S_F</id></record>
      <record><l>Tesco Extra Serpentine Green The Serpentine Peterborough PE7 8BD England</l>
               <id>2104076_0L_F</id></record>
      <record><l>Tesco 1 Market Rise Cherry Hinton Road Cambridge Cambridgeshire CB1 7DZ England</l>
               <id>33896480_2938173S_F</id></record>

   </addressdata>
</data>

<errormessage> should be displayed if populated

If <recordcount>0</recordcount> then nothing found

If <recordcount>100</recordcount> then you need to refine the search query since this query will return a maximum of 100 lines. In which case you should add a line to the list saying “Gone over limit of 100 lines, please refine search....”. To test this set to organisation=”tesco” and townorvillage=”London”

If used by employee of company (classed as "Internal use")

It is a requirement of the royal mail that if postcode lookup software is used by an employee of a company, then the user must be uniquely identified so we can apply a user count.

Therefore the URL must contain a User ID:

www.simplylookupadmin.co.uk/XMLservice/XMLSearchForAddress.aspx?datakey=Your Data Key &organistaion=Tesco&buildingornumber=&street=&townorvillage=&county=Cambridgeshire&pobox=&postarea= &username=UserID

This will be the datakey beginning with "I"

Section 3.5 of the Terms and Conditions state: "The Customer, when using the Postcode Lookup service via Web Service, must make sure each user is identified by a unique Computer name, in each call to the Web Service if used internally”. In simple language this means that each user must be identified by a unique computer name, in username parameter, if used by a company employee.


Get Thoroughfare/Street from HTTP/XML Web Service:


To get a Thoroughfare/Street address from our HTTP/XML Web Service we do the following:

Call XMLService/XMLSearchForThoroughfareAddress.aspx to get address record

This call will retrieve the Thoroughfare Address Data (Royal Mail Thoroughfare PAF) for a given Postcode. The Thoroughfare Address is a cut down version of the Full Address, basically it does not contain the Building name or number. Therefore the programmer should allow the user to enter the House Name/Number for the address. These licenses are cheaper than Full Postcode data.

Example:

Call HTTP web service with your data key, which is e-mailed to you when you open an account.  The data key identifies your account and licenses.

www.simplylookupadmin.co.uk/XMLservice/XMLSearchForThoroughfareAddress.aspx?datakey=Your Data Key
&postcode=pe132ql&version=2

   Returns
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
   <!DOCTYPE data [
   <!ELEMENT data(found,credits_ display_text, accountadminpage, errormessage,record)>

   <!ELEMENT found (#PCDATA)>
   <!ELEMENT credits_display_text (#PCDATA)>
   <!ELEMENT accountadminpage (#PCDATA)>
   <!ELEMENT errormessage (#PCDATA)>
   <!ELEMENT record (line1,line2,line3,town,county,postcode, country, rawpostcode, mailsortcode, spare)>

      <!ELEMENT line1 (#PCDATA)>
      <!ELEMENT line2 (#PCDATA)>
      <!ELEMENT line3 (#PCDATA)>
      <!ELEMENT town (#PCDATA)>
      <!ELEMENT county (#PCDATA)>
      <!ELEMENT postcode (#PCDATA)>
      <!ELEMENT country (#PCDATA)>
      <!ELEMENT rawpostcode (#PCDATA)>
      <!ELEMENT mailsortcode (#PCDATA)>
      <!ELEMENT spare (#PCDATA)>
      ]>
   <errormessage></errormessage>
   <credits_display_text>Evaluation expires 28 Jul 2010</credits_display_text>
   <accountadminpage>https://www.xxx...</accountadminpage>
   <errormessage></errormessage>

   <record>
      <line1>Vicrotia Rd</line1>
      <line2></line2>
      <line3></line3>
      <town>Wisbech</town>
      <county>Cambridgeshire</county>
      <postcode>PE13 2QL</postcode>
      <country>England</country>
      <rawpostcode>PE132QL</rawpostcode>

      <mailsortcode>1033</mailsortcode>
      <spare></spare>
   </record>
</data>

If address returned then <found>=1, else <found>=0,error in <errormessage>

If used by employee of company (classed as "Internal use")

It is a requirement of the royal mail that if postcode lookup software is used by an employee of a company, then the user must be uniquely identified so we can apply a user count.

Therefore the URL must contain a User ID:

www.simplylookupadmin.co.uk/XMLservice/XMLSearchForThoroughfareAddress.aspx?datakey=Your Data Key
&postcode=pe132ql&version=2&username=UserID

This will be the datakey beginning with "I"

Section 3.5 of the Terms and Conditions state: "The Customer, when using the Postcode Lookup service via Web Service, must make sure each user is identified by a unique Computer name, in each call to the Web Service if used internally”. In simple language this means that each user must be identified by a unique computer name, in username parameter, if used by a company employee.

video  Full Online API Reference Manual : HTTP/XML Web Service