Europe

Geocode.xyz Europe

The Geocode.xyz Geocoding/Geoparsing API

This is a geocoding/geoparsing API. It receives text input and outputs location information in XML,CSV, JSON, GeoJSON Formats in the area of coverage. (see the Examples Section)
You may access this API either from your own code via a HTTP request (examples:
Reverse Geocoding:
curl 'https://geocode.xyz/51.50354,-0.12768?geoit=xml'
Geoparsing:
curl -X POST -d scantext="Ma io stasera volevo cenare al lume di candela, non cucinarci! #milano #blackout" \
        -d geoit="XML" \
        https://geocode.xyz  
curl -X POST -d scantext="The Vienna Tourist Board [3] operates information and booking booths at the airport Arrival Hall, 7AM-11PM and in the center at 1., Albertinaplatz/Maysedergasse. Information and free maps are also avialable from the ÖBB InfoPoints and offices at train stations." \
        -d json="1" \
        https://geocode.xyz 
curl -X POST -d scantext="The most important museums of Amsterdam are located on the Museumplein, located at the southwestern side of the Rijksmuseum." \
        -d geojson="1" \
        https://geocode.xyz  
Forward Geocoding:
curl -X POST -d locate="London UK" \
        -d geoit="XML" \
        https://geocode.xyz
), or via a third party module (eg: Geo::Parser::Text)
What is Geocoding? Geocoding is an information retrieval process that is normally divided into Forward Geocoding and Reverse Geocoding


Forward Geocoding is the process of converting a location (like "Plaza Volateria 3 Parque de Negocios Mas Blau I El Prat de Llobregat 08820 Spain") into geographic coordinates (like latitude 41.3189957000 and longitude 2.0746469000).


Reverse Geocoding is the process of converting a latitude,longitude point (like 41.3189957000, 2.0746469000 ) into the description of a location nearest to it (like 1 VOLATERIA Plaza, EL PRAT DE LLOBREGAT, ES)


The Geocode.xyz API provides a direct way to Forward and Reverse Geocode* or Geoparse* European locations in text.

* Geocoding returns a single location coordinates (the match with the highest probability), while Geoparsing returns all locations matched ordered by confidence score.

Usage Limits There are currently no usage limits but response times are normally throttled to no more than 1 request per second.

If that is too slow for you, get your own server on the Amazon Cloud using this AMI.
Geocoding API Request Format A Geocoding API request must be of the following form:


https://geocode.xyz/location?outputformat


There are 4 possible output formats:

  1. https://geocode.xyz/41.3189957000,2.0746469000?json=1 ~ json (recommended) indicates output in JavaScript Object Notation (JSON)
  2. https://geocode.xyz/41.3189957,2.0746469?jsonp=1&callback=test ~ jsonp indicates output in "JSON with padding" (JSONp)
  3. https://geocode.xyz/1 VOLATERIA Plaza, EL PRAT DE LLOBREGAT?geoit=xml ~ xml indicates output as XML
  4. https://geocode.xyz/1 VOLATERIA Plaza, EL PRAT DE LLOBREGAT?geoit=csv ~ csv indicates output as CSV
Geoparsing API Request Format A Geoparsing API request must be of the following form:


https://geocode.xyz/?scantext=text&outputformat


(you may also send text to the API via a POST method)

Geocoding and Geoparsing Lookups

Required parameters There is only one required parameter for single location geocoding - locate, and one required parameter for geoparsing - scantext.

You may pass the location to the API directly as in: https://geocode.xyz/location or via a parameter name as in: https://geocode.xyz/?locate=location
Parameter Name DescriptionPermitted Values
locate The location may be a street address in the areas of coverage in the EU, or similarly a latitude,longitude point in the EU. A string containing a free text location or a point expressed as a latitude,longitude pair (in that order!)
scantext Free form text containing locations. text

If the output parameters are ommited, the output will default to html.
Otherwise you have four output options to choose from, as shown above (XML, JSON, JSONp and CSV)
Optional parameters
Parameter Name DescriptionPermitted Values
region The region parameter defines the region/country to limit the search results for geoparsing functions (scantext) or single response geocoding (locate) Allowed Values: {AD, AL, AM, AT, AZ, BA, BE, BG, BY, CH, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GE, GR, HR, HU, IE, IL, IM, IS, IT, KS, LI, LT, LU, LV, MC, MD, ME, MK, MT, NL, NO, PL, PT, RO, RS, RU, SE, SI, SK, TR, UA, UK, }

For example: region=UK (limit to the UK) or region=FR (limit to France)
You may also submit more than one region codes divided by commas ",". For example: region=UK,FR (limit to either the UK or France).

decimal An integer positive number. This is an optional parameter to limit the number of decimal places in the response. (note that a small number will reduce accuracy)
geoit The output type desired. Only one of two allowed values: XML or CSV
json Output in JSON format. Optionally you may request data in JSON format. Accepted value: 1
geojson Output in GeoJSON format. Optionally you may request data in GeoJSON format. Accepted value: 1
jsonp Output in JSONP format. Optionally you may request data in JSONP format. Accepted value: 1
callback Callback string if Output is in JSONP format. Optionally you may request data in JSONP format. The callback can be any string value and is required if you request JSONp output.
id optionally you can include your own transaction id. this will be returned along with the response if provided. a number or string no longer that 15 bytes.
strictmode Optionally you can prevent the geocoder from making too many guesses on your input. This is now the default, but you may disable it with nostrict Allowed values are Integer 0 or 1.
nostrict Set promiscuous mode on. Will return all matched locations, even those with low confidence. (might result in a lot of matched items in geoparsing mode) Allowed values are Integer 0 or 1.

Geocoding and/or Geoparsing Responses Geocoding/Geoparsing responses are returned in the format indicated by the output flag within the URL request's path.

The output may contain the following parameters:

Parameter Name DescriptionExpected Output Values
latt The latitude. A decimal number.
longt The longitude. A decimal number.
id Transaction id. If supplied in the input the transaction id will be returned along with the output.
stnumber The properly formated address to be returned. The street number (integer value).
staddress The properly formated address to be returned. The formated street address.
city The properly formated address to be returned. The city name.
prov The properly formated address to be returned. The country code.
countryname The properly formated address to be returned. The country name.
confidence The Geocoding Confidence Score is a number representing our accuracy estimate on a geocoding request. This number ranges from 1 to 0. A higher score indicates a closer match (A score of 1 meaning best match accuracy.) A result with confidence score less than 0.5 is never returned to the user (it will most likely result in a suggestion being returned.) a number [0..1] 1=best match, 0=no response.
MentionIndices In a Geoparsing response indicates the index location in the string where a given location was matched. One or more numbers, separated by commas.
matchtype In a Geoparsing response indicates the type of location matched. Possible values {street, intersection, locality, landmark, postcode}
inlatt The input latitude. If the input contains a latitude/longitude pair for reverse geocoding.
inlongt The input longitude. If the input contains a latitude/longitude pair for reverse geocoding.
distance The distance of the result location from the input location.
NearRoad The nearest Road to the input point.
NearRoadDistance The distance of the nearest Road to the input point.

Error Codes The output could contain an error code. If your query does not produce coordinates the latt and longt containers will be empty.
These are the error codes that could be returned upon an unsuccessful lookup:

005 Postal Code is not in the proper Format.

007 Supply a valid query.

008 Your request did not produce any results. Check your spelling and try again.

Sometimes when a location is not found a suggestion (or more) will be contained within <suggestion> xml tags. for example:

Batch Geocoding Example

Bash one liner for batch geocoding CSV/Text files using the geocode.xyz CSV API Here is a bash one liner that takes as input a CSV file of locations, and outputs the file with the location information appended at the end of each line:
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
    echo $line,`curl -X POST -d locate="$line" -d geoit="csv" https://geocode.xyz`;
done < "$1"
Save as geocode.sh then chmod a+x geocode.sh then run it as:
./geocode.sh input.csv>output.csv

Your input file might look something like:
input.csv

Berlin, DE
London, UK
Rome, IT
and the output

output.csv

Berlin, DE,200,0.90,52.50219,13.40741
London, UK,200,0.90,51.50565,-0.11599
Rome, IT,200,0.80,41.94176,12.61489
Four columns were appended to the input file. The status (200 success), the confidence score (a number between 0 and 1, with 1 being best match), the Latitude and the Longitude.



- (optional)

About Geocode.xyz

This API provides forward/reverse geocoding, batch geocoding and geoparsing for Europe. Click for coverage area.
Read our API docs for more. Use Cases: Civic Address Geocoding, Reverse geocoding for fleet management, Microblog feed geoparsing, Address cleanup and standardization, Batch Geocoding and Geoparsing on large bodies of text, Geo Analytics, etc. Eg, OpenWikiMap.org

Geoparsing and Geocoding and Batch Geocoding Examples

Forward and Reverse Geocoding
  1. Museumplein, Amsterdam
  2. 2 Colomines, Barcelona, ES
  3. Antoine Dansaertstraat, Brussels
  4. Karlsplatz, Vienna
  5. Nyhavn, Copenhagen
  6. 55.6802779000,12.5900501000
  7. B72 1JU

Geoparsing News Feeds.

Geoparse & Geocode .

for more information

North America

geocode.xyz © 2017. Legal