---
title: "Geocode an address"
method: GET
path: "/geoloc/search"
tags: ["geolocalisation"]
---

# Geocode an address

`GET /geoloc/search`

## Request

- Base URL: `http://free.gisgraphy.com`
- URL: `http://free.gisgraphy.com/geoloc/search`
- Auth: API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/gisgraphy/apis/gisgraphy-webservices/docs/geoloc/search/get.ts> (a function with typed inputs; its response is checked against the schema)

The geolocalisation service allows to search for features around a earth location. you can Specify GPS position, Limit the results to a specific place type (e.g : search all monuments around a point), Limit the results to a specified radius, Paginate the results, Tells if you want the output to be indented (currently, applies only for XML, not JSON for performance reasons. May change in next version)

## Query parameters

- `lat` number, double, required
- `lng` number, double, required
- `radius` number, double
- `distance` boolean
- `placetype` string
- `format` 'XML' | 'JSON' | 'PHP' | 'RUBY' | 'PYTHON' | 'YAML'
- `from` integer
- `to` integer
- `callback` string
- `indent` boolean

## Response `200`

Sucessfully processed

- GeolocResultsDto
  - `numFound` integer: The number of results display with this query (it takes the pagination into account)
  - `QTime` integer: The execution time of the query in ms
  - `result` GisFeatureDistance[]
    - `distance` number, double: The distance beetween the point and the gisFeature in meters
    - `name` string: The name of the feature
    - `adm1Code` string: The internal code for the administrative division of level 1
    - `adm2Code` string: The internal code for the administrative division of level 2
    - `adm3Code` string: The internal code for the administrative division of level 3
    - `adm4Code` string: The internal code for the administrative division of level 4
    - `adm5Code` string: The internal code for the administrative division of level 5
    - `adm1Name` string: The name of the administrative division of level 1
    - `adm2Name` string: The name of the administrative division of level 2
    - `adm3Name` string: The name of the administrative division of level 3
    - `adm4Name` string: The name of the administrative division of level 4
    - `adm5Name` string: The name of the administrative division of level 5
    - `asciiName` string: The ASCII name of the feature
    - `countryCode` string: The ISO 3166 country code
    - `elevation` integer: The elevation in meters
    - `featureClass` string: The feature Class.
    - `featureCode` string: The feature Code.
    - `featureId` integer: A unique id that identify the feature
    - `gtopo30` integer: Average elevation of 30'x30' (ca 900mx900m) area in meters
    - `population` integer: How many people lives in this feature
    - `timezone` string: The time zone (e.g : Europe/Paris)
    - `lat` number, double: The latitude (north-south)
    - `lng` number, double: The longitude (east-West)
    - `placeType` string: The Type of Feature see faq
    - `oneWay` boolean: Wether the street is oneway or not
    - `streetType` string: the type of the street
    - `openstreetmapId` integer: the id of the openstreetmap element
    - `length` number, double: length of the street
    - `zipCodes` string[]: The zipcodes (only for city and city subdivision), one node by zipcode
    - `google_map_url` string: The URL to get the location on Google Map
    - `yahoo_map_url` string: The URL to get the location on Yahoo Map
    - `openstreetmap_map_url` string: The URL to get the location on Openstreetmap Map
    - `country_flag_url` string: The relative URL to get the country flag image
    - `level` integer: The level of the Administrative division (1-5)
    - `area` number, double: The area of the feature
    - `tld` string: top-level domain name, (last part of an Internet domain name) of the country
    - `capitalName` string: The Capital of the country
    - `continent` string: The continent the country belongs
    - `postalCodeRegex` string: The regexp that all zipcode/postalcode of the country matches
    - `currencyCode` string: The Currency code (ISO_4217) of the country
    - `currencyName` string: The Currency name of the country
    - `equivalentFipsCode` string: The fips Code of the country when no code are available
    - `fipsCode` string: The fips Code of the country
    - `iso3166Alpha2Code` string: The iso 3166 Alpha 2 code of the country
    - `iso3166Alpha3Code` string: The iso 3166 Alpha 3 code of the country
    - `iso3166NumericCode` string: The iso 3166 numeric code of the country
    - `phonePrefix` string: The phone prefix of the country
    - `postalCodeMask` string: The mask that all postal code of the country matches
    - `isIn` string: Information of the city where the street / POI is (depends on openstreetmap 'is_in' field), the city in general (only for placetype street)
    - `isInPlace` string: Information of the place where the street / POI is (quarter, common place). Generally a place at a lower level than city
    - `isInAdm` string: Information of the administration division where the street / POI is.
    - `isInZip` string: Information of the zipcode where the street / POI is"
    - `amenity` string: Informations on category of OpenStreetMap POIs
    - `fullyQualifiedAddress` string: NOT USED YET
  - `error` string: A String only present if an error occured (e.g : empty Latitude or longitude)

## Other responses

- `401`: Need auth. The API key parameter is missing or wrong, or doesn't correspond to any subscriptions
- `403`: Unhauthorize (auth will change nothing).Your IP is not allowed.
- `412`: Missing parameter. Some parameters required for the webservices ar missing, please consult documentation
- `429`: Too many requests. You exceed the authorized rate
- `500`: Internal error

---

[API](https://skmtc.dev/gisgraphy/apis/gisgraphy-webservices.md) - [All operations](https://skmtc.dev/gisgraphy/apis/gisgraphy-webservices/llms.txt) - [OpenAPI document](https://skmtc.dev/gisgraphy/apis/gisgraphy-webservices/revisions/3f91690c0e06?raw)
