Skip to content

Instantly share code, notes, and snippets.

@stephenkeable-allies
stephenkeable-allies / postcoder_web_example.php
Last active March 13, 2019 12:22
Example code for using Postcoder Web in PHP. For more information on Postcoder Web visit http://www.alliescomputing.com/products/postcoder-web-api
<?php
/*
PostCoder Web Service V3 example
Allies Computing Ltd 2014
Demonstrates UK Address lookup rest web service
Product URL: https://www.alliescomputing.com/postcoder/address-lookup
Technical Specs: https://developers.alliescomputing.com/postcoder-web-api/address-lookup/premise
Example output: http://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/address/UK/NR147PZ
@stephenkeable-allies
stephenkeable-allies / postcoder_web_example.cs
Last active March 13, 2019 12:22
Example code for using Postcoder Web in C#. For more information on Postcoder Web visit http://www.alliescomputing.com/products/postcoder-web-api
// PostCoder Web Service V3 example
// Allies Computing Ltd 2013
//
// Demonstrates UK Address lookup rest web service
//
// Product URL: https://www.alliescomputing.com/postcoder/address-lookup
// Technical Specs: https://developers.alliescomputing.com/postcoder-web-api/address-lookup/premise
// Example output: http://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/address/UK/NR147PZ
//
// This demo shows how to perform an address lookup and parse the results into C# objects.
@stephenkeable-allies
stephenkeable-allies / postcoder_web_example.vb
Last active March 13, 2019 12:22
Example code for using Postcoder Web in VB .NET. For more information on Postcoder Web visit http://www.alliescomputing.com/products/postcoder-web-api
' PostCoder Web Service V3 example
' Allies Computing Ltd 2013
'
' Demonstrates UK Address lookup rest web service
'
' Product URL: https://www.alliescomputing.com/postcoder/address-lookup
' Technical Specs: https://developers.alliescomputing.com/postcoder-web-api/address-lookup/premise
' Example output: http://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/address/UK/NR147PZ
'
' This demo shows how to perform an address lookup and parse the results into VB.Net objects.
@stephenkeable-allies
stephenkeable-allies / postcoder_web_example.java
Last active March 13, 2019 12:22
Example code for using Postcoder Web in Java. For more information on Postcoder Web visit http://www.alliescomputing.com/products/postcoder-web-api
// PostCoder Web Service V3 example
// Allies Computing Ltd 2013
//
// Demonstrates UK Address lookup rest web service
//
// Product URL: https://www.alliescomputing.com/postcoder/address-lookup
// Technical Specs: https://developers.alliescomputing.com/postcoder-web-api/address-lookup/premise
// Example output: http://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/address/UK/NR147PZ
//
// This demo shows how to perform an address lookup and parse the results into Java objects.
@stephenkeable-allies
stephenkeable-allies / postcoder_web_example.rb
Last active March 13, 2019 12:22
Example code for using Postcoder Web in Ruby. For more information on Postcoder Web visit http://www.alliescomputing.com/products/postcoder-web-api
# PostCoder Web Service V3 example
# Allies Computing Ltd 2014
#
# This demo shows how to perform an address lookup in ruby.
#
# Note: This script has been developed for ruby >= 1.9.3
#
require 'cgi'
require 'json'
@stephenkeable-allies
stephenkeable-allies / postcoder_web_example.py
Last active March 13, 2019 12:22
Example code for using Postcoder Web in Python. For more information on Postcoder Web visit http://www.alliescomputing.com/products/postcoder-web-api
# PostCoder Web Service V3 example
# Allies Computing Ltd 2014
#
# This demo shows how to perform an address lookup in Python.
#
import json
import urllib
searchkey = 'PCW45-12345-12345-1234X'; # Test search key, replace with your
@stephenkeable-allies
stephenkeable-allies / geocoding.php
Created February 20, 2015 13:45
Basic PHP Geocoding Example using PostCoder Web. Find out more at - http://developers.alliescomputing.com/postcoder-web-api/geocoding/position
<?php
// Check if POST request has been made
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// Basic validation on the postcode field
if(array_key_exists('postcode', $_POST) and !empty($_POST['postcode'])) {
// Insert your PostCoder Web API Key here
// Sign up for free at www.alliescomputing.com/postcoder/sign-up
$pcw_api_key = "YOUR-API-KEY-HERE";
<?php
// Check if POST request has been made
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// Basic validation on the postcode field
if(array_key_exists('postcode', $_POST) and !empty($_POST['postcode'])) {
// Insert your PostCoder Web API Key here
// Sign up for free at www.alliescomputing.com/postcoder/sign-up
$pcw_api_key = "YOUR-API-KEY-HERE";
@stephenkeable-allies
stephenkeable-allies / email-validation.php
Created February 20, 2015 13:46
Basic PHP Email Validation Example using PostCoder Web. Find out more at - http://developers.alliescomputing.com/postcoder-web-api/email-validation
<?php
// Check if POST request has been made
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// Basic validation on the email field
if(array_key_exists('email', $_POST) and !empty($_POST['email'])) {
// Insert your PostCoder Web API Key here
// Sign up for free at www.alliescomputing.com/postcoder/sign-up
$pcw_api_key = "YOUR-API-KEY-HERE";
@stephenkeable-allies
stephenkeable-allies / country-list.php
Created February 20, 2015 13:46
Basic PHP Country List Example using PostCoder Web. Find out more at - http://developers.alliescomputing.com/postcoder-web-api/geocoding/countries
<?php
// Insert your PostCoder Web API Key here
// Sign up for free at www.alliescomputing.com/postcoder/sign-up
$pcw_api_key = "YOUR-API-KEY-HERE";
// URL we are calling with API key and url encoded postcode
$pcw_country_url = "http://ws.postcoder.com/pcw/". $pcw_api_key ."/country";
// Get and JSON decode the response from the service