API Examples

Postcode details postcode

api.askthepigeon.com/postcode/
http://api.askthepigeon.com/postcode/SW1A2AA
{
    "postcode": [
        {
            "numeric_id": "2208315",
            "pcd": "SW1A2AA",
            "pcd2": "SW1A 2AA",
            "pcds": "SW1A 2AA",
            "dointr": "1980-01-01",
            "doterm": null,
            "oscty": "E99999999",
            "oslaua": "E09000033",
            "osward": "E05000644",
            "usertype": "1",
            "oseast1m": "530047",
            "osnrth1m": "179951",
            "osgrdind": "1",
            "oshlthau": "E18000007",
            "hro": "E19000003",
            "ctry": "E92000001",
            "gor": "E12000007",
            "streg": "5",
            "pcon": "E14000639",
            "eer": "E15000007",
            "teclec": "E24000014",
            "ttwa": "E30000234",
            "pct": "E16000057",
            "nuts": "E05000644",
            "psed": "01BKFW15",
            "cened": "APFW15",
            "edind": "1",
            "oshaprev": "Q04",
            "lea": "213",
            "oldha": "QA3",
            "wardc91": "01APFW",
            "wardo91": "01BKFW",
            "ward98": "00BKFW",
            "statsward": "00BKGQ",
            "oa01": "E00023936",
            "casward": "00BKGQ",
            "park": "E99999999",
            "lsoa01": "E01004736",
            "msoa01": "E02000977",
            "ur01ind": "5",
            "oac01": "2B2",
            "oldpct": "5LC",
            "oa11": "E00023936",
            "lsoa11": "E01004736",
            "msoa11": "E02000977",
            "parish": "E43000236",
            "wz11": "E33031086",
            "ccg": "E38000031",
            "bua11": "E34004707",
            "buasd11": "E35000546",
            "ru11ind": "A1",
            "oac11": "2B2",
            "lat": "51.503540",
            "long": "-0.127695",
            "lep1": "E37000023",
            "lep2": null,
            "wdcd": "E05000644",
            "wdnm": "St James's",
            "ladcd": "E09000033",
            "ladnm": "Westminster",
            "ctycd": "E13000001",
            "ctynm": "Inner London",
            "rgncd": "E12000007",
            "rgnnm": "London",
            "ctrycd": "E92000001",
            "ctrynm": "England",
            "council_type": "London Borough",
            "uk_postcode_id": "1109672",
            "postcode": "SW1A2AA",
            "postcode_ns": "SW1A 2AA",
            "total": "5",
            "males": "2",
            "females": "3",
            "occupied_households": "1"
        }
    ]
}
api.askthepigeon.com/nearest-postcode/ /count/
http://api.askthepigeon.com/nearest-postcode/SW1A2AA/count/2
{
    "nearest_postcode": [
        {
            "pcds": "SW1H 0BT",
            "lat": "51.499946",
            "long": "-0.133000",
            "distance": 543,
            "direction": 223
        },
        {
            "pcds": "SW1H 0BU",
            "lat": "51.499946",
            "long": "-0.133000",
            "distance": 543,
            "direction": 223
        }
    ]
}

Nearby postcodes - Lat/Long input latitude longitude count

api.askthepigeon.com/nearest-postcode/lat/ /long/ /count/
http://api.askthepigeon.com/nearest-postcode/lat/51.50354/long/-0.127695/count/2
{
    "nearest_postcode": [
        {
            "pcds": "SW1H 0BT",
            "lat": "51.499946",
            "long": "-0.133000",
            "distance": 543,
            "direction": 223
        },
        {
            "pcds": "SW1H 0BU",
            "lat": "51.499946",
            "long": "-0.133000",
            "distance": 543,
            "direction": 223
        }
    ]
}
api.askthepigeon.com/convert/lat/ /long/
http://api.askthepigeon.com/convert/lat/51.50354/long/-0.127695
{
    "converted_eastnorth_values": {
        "easting": 529934.09238357,
        "northing": 180004.98808497
    }
}
api.askthepigeon.com/convert/east/ /north/
http://api.askthepigeon.com/convert/east/529934.09/north/180004.99
{
    "converted_latlong_values": {
        "latitude": 51.503540017752,
        "longitude": -0.12769503374296
    }
}
api.askthepigeon.com/random-postcode
http://api.askthepigeon.com/random-postcode
{
    "postcode": [
        {
            "numeric_id": "1816484",
            "pcd": "PR8 2GF",
            "pcd2": "PR8  2GF",
            "pcds": "PR8 2GF",
            "dointr": "1996-12-01",
            "doterm": "2006-04-01",
            "oscty": "E99999999",
            "oslaua": "E08000014",
            "osward": "E05000941",
            "usertype": "1",
            "oseast1m": "334904",
            "osnrth1m": "414948",
            "osgrdind": "1",
            "oshlthau": "E18000002",
            "hro": "E19000001",
            "ctry": "E92000001",
            "gor": "E12000002",
            "streg": "8",
            "pcon": "E14000958",
            "eer": "E15000002",
            "teclec": "E24000023",
            "ttwa": "E30000233",
            "pct": "E16000090",
            "nuts": "E05000941",
            "psed": "03CAFK23",
            "cened": "CAFK23",
            "edind": "1",
            "oshaprev": "Q15",
            "lea": "343",
            "oldha": "QC7",
            "wardc91": "04CAFK",
            "wardo91": "03CAFK",
            "ward98": "00CAFK",
            "statsward": "00CAHJ",
            "oa01": "E00035465",
            "casward": "00CAGK",
            "park": "E99999999",
            "lsoa01": "E01007002",
            "msoa01": "E02001436",
            "ur01ind": "5",
            "oac01": "4B2",
            "oldpct": "5F9",
            "oa11": "E00035465",
            "lsoa11": "E01007002",
            "msoa11": "E02001436",
            "parish": "E43000168",
            "wz11": "E33003138",
            "ccg": "E38000170",
            "bua11": "E34999999",
            "buasd11": "E35999999",
            "ru11ind": "C1",
            "oac11": "6A3",
            "lat": "53.626998",
            "long": "-2.985762",
            "lep1": "E37000022",
            "lep2": null,
            "wdcd": "E05000941",
            "wdnm": "Kew",
            "ladcd": "E08000014",
            "ladnm": "Sefton",
            "ctycd": "E11000002",
            "ctynm": "Merseyside",
            "rgncd": "E12000002",
            "rgnnm": "North West",
            "ctrycd": "E92000001",
            "ctrynm": "England",
            "council_type": "Metropolitan District",
            "uk_postcode_id": null,
            "postcode": null,
            "postcode_ns": null,
            "total": null,
            "males": null,
            "females": null,
            "occupied_households": null
        }
    ]
}

Nearby transport stops latitude longitude count

api.askthepigeon.com/nearest-transport/all/lat/ /long/ /count/
http://api.askthepigeon.com/nearest-transport/all/lat/51.50354/long/-0.127695/count/2
{
    "nearest_transport": [
        {
            "NaptanCode": "91573",
            "CommonName": "Pall Mall  St James's Palace",
            "Indicator": "Stop",
            "StopType": "BCT",
            "Street": "---",
            "latitude": "51.5052602700000",
            "longitude": "-0.1376643340000",
            "distance": 716,
            "direction": 285
        },
        {
            "NaptanCode": "54915",
            "CommonName": "Westminster City Hall",
            "Indicator": "SB",
            "StopType": "BCT",
            "Street": "VICTORIA STREET",
            "latitude": "51.4971543200000",
            "longitude": "-0.1374473260000",
            "distance": 980,
            "direction": 224
        }
    ]
}

Nearby transport stops - Rail latitude longitude count

api.askthepigeon.com/nearest-transport/rail/lat/ /long/ /count/
http://api.askthepigeon.com/nearest-transport/rail/lat/51.50354/long/-0.127695/count/2
{
    "nearest_station": [
        {
            "CrsCode": "CHX",
            "CommonName": "London Charing Cross Rail Station",
            "StopType": "RLY",
            "latitude": "51.5080318300000",
            "longitude": "-0.1247977350000",
            "distance": 538,
            "direction": 22
        },
        {
            "CrsCode": "WAT",
            "CommonName": "London Waterloo Rail Station",
            "StopType": "RLY",
            "latitude": "51.5033028900000",
            "longitude": "-0.1131041930000",
            "distance": 1010,
            "direction": 91
        }
    ]
}

Nearby transport stops - Air latitude longitude count

api.askthepigeon.com/nearest-transport/air/lat/ /long/ /count/
http://api.askthepigeon.com/nearest-transport/air/lat/51.50354/long/-0.127695/count/2
{
    "nearest_air": [
        {
            "CrsCode": "LHR",
            "CommonName": "London Heathrow Airport Terminal 3",
            "latitude": "51.4694622300000",
            "longitude": "-0.4614586420000",
            "distance": 23418,
            "direction": 261
        },
        {
            "CrsCode": "LHR",
            "CommonName": "London Heathrow Airport Terminal 5",
            "latitude": "51.4710602500000",
            "longitude": "-0.4882150370000",
            "distance": 25221,
            "direction": 262
        }
    ]
}

Nearby points of interest latitude longitude count

api.askthepigeon.com/nearest-poi/lat/ /long/ /count/
http://api.askthepigeon.com/nearest-poi/lat/51.50354/long/-0.127695/count/2
{
    "nearest_poi": [
        {
            "poi_id": "445659",
            "slug": "privy-council-office",
            "longitude": "-0.1263840050",
            "latitude": "51.5037422180",
            "province": "Greater London",
            "city": "Westminster",
            "name": "Privy Council Office",
            "country": "GB",
            "phone": "+44 20 7270 0472",
            "address": "68 Whitehall",
            "postcode": "SW1A 2AT",
            "tags": [
                "central"
            ],
            "classifier_1": [
                "Public Place",
                "Government",
                "Office"
            ],
            "classifier_2": [
                ""
            ],
            "classifier_3": [
                ""
            ],
            "url": "",
            "source": "OpenStreetMaps",
            "source_identifier": "0",
            "distance": "0.09348490457382026"
        },
        {
            "poi_id": "1228607",
            "slug": "department-of-health_2",
            "longitude": "-0.1261499971",
            "latitude": "51.5028457642",
            "province": "Greater London",
            "city": "London",
            "name": "Department of Health",
            "country": "GB",
            "phone": "+44 20 7210 4850",
            "address": "79 Whitehall",
            "postcode": "SW1A 2NL",
            "tags": [
                "central"
            ],
            "classifier_1": [
                "Public Place",
                "Government",
                "Office"
            ],
            "classifier_2": [
                ""
            ],
            "classifier_3": [
                ""
            ],
            "url": "",
            "source": "OpenStreetMaps",
            "source_identifier": "0",
            "distance": "0.13188990268065692"
        }
    ]
}
api.askthepigeon.com/land-use/
http://api.askthepigeon.com/land-use/SW1A2AA
{
    "land_use": [
        {
            "postcode_area_id": "4350135",
            "postcode": "SW1A2AA",
            "output_area": "E00023936",
            "l_output_area": "E01004736",
            "m_output_area": "E02000977",
            "area_id": "23908",
            "lsoa": "E01004736",
            "total_area": "1181.34",
            "domestic_buildings_area": "72.93",
            "non_domestic_buildings_area": "281.55",
            "road_area": "290.07",
            "path_area": "34.89",
            "rail_area": "0.09",
            "domestic_gardens_area": "11.66",
            "greenspace_area": "352.41",
            "water_area": "1.04",
            "other_area": "136.71",
            "unclassified_area": "0.00"
        }
    ]
}

Nearby recent crimes latitude longitude count

api.askthepigeon.com/nearest-crime/lat/ /long/ /count/
http://api.askthepigeon.com/nearest-crime/lat/51.50354/long/-0.127695/count/2
{
    "nearest_crime": [
        {
            "crime_id": "",
            "month": "2014-03",
            "reported_by": "Metropolitan Police Service",
            "falls_within": "Metropolitan Police Service",
            "latitude": "51.5075690000",
            "longitude": "-0.1328330000",
            "location": "On or near Waterloo Place",
            "lsoa_code": "E01004736",
            "lsoa_name": "Westminster 018C",
            "crime_type": "Anti-social behaviour",
            "last_outcome_category": "",
            "distance": 572,
            "direction": 322
        },
        {
            "crime_id": "",
            "month": "2014-03",
            "reported_by": "Metropolitan Police Service",
            "falls_within": "Metropolitan Police Service",
            "latitude": "51.5075690000",
            "longitude": "-0.1328330000",
            "location": "On or near Waterloo Place",
            "lsoa_code": "E01004736",
            "lsoa_name": "Westminster 018C",
            "crime_type": "Anti-social behaviour",
            "last_outcome_category": "",
            "distance": 572,
            "direction": 322
        }
    ]
}