How to Use Address Geolocation API

The ability to obtain accurate address information is fundamental for a multitude of applications and businesses. Whether it’s for delivery services, location-based marketing, or even real estate analysis, EasyAPI’s Address Endpoint has you covered. This endpoint can provide an extensive range of information like date/time details, formatted address, geographical coordinates, and much more.
Pre-Requisites
To start using this endpoint, you’ll need an API key from EasyAPI. If you haven’t obtained this yet, you can refer to our Getting Started Guide.
Step 1: Make an API Request
In Browser
Simply paste the following URL into your browser, replacing YOUR_API_KEYÂ with your actual API key:
https://api.easyapi.io/v1.0/address?address=mayflower%20street,%20london&api_key=YOUR_API_KEY
In Python
Using Python’s requests library, the API call can be made as follows:
import requests
import json
response = requests.get("https://api.easyapi.io/v1.0/address?address=mayflower%20street,%20london&api_key=YOUR_API_KEY")
data = json.loads(response.text)
To run this code, install the requests library if you haven’t yet:
pip install requests
In PHP
In PHP, use curl to make the API request:
Step 2: Analyze the Response
The API will return a JSON response, similar to the one below:
{
"class":"address_info",
"properties":[
{
"datetime":{
"date":"08/23/2023",
"date_time":"08/23/2023 20:39:30",
"date_time_txt":"Wednesday, August 23, 2023 20:39:30",
"date_time_wti":"Wed, 23 Aug 2023 20:39:30 +0100",
"date_time_ymd":"2023-08-23T20:39:30+0100",
"day":"23",
"day_abbr":"Wed",
"day_full":"Wednesday",
"day_wilz":"23",
"hour_12_wilz":"08",
"hour_12_wolz":"8",
"hour_24_wilz":"20",
"hour_24_wolz":"20",
"hour_am_pm":"pm",
"minutes":"39",
"month":"08",
"month_abbr":"Aug",
"month_days":"23",
"month_full":"August",
"month_wilz":"08",
"seconds":"30",
"time":"20:39:30",
"week":"34",
"year":"2023",
"year_abbr":"23"
},
"formatted_address":"Mayflower St, London SE16, UK",
"location":"51.5000232,-0.0551781",
"timezone":{
"capital":"London",
"continent":"EU",
"country":"Britain (UK)",
"country_code":"GB",
"currency_alpha_code":"GBP",
"currency_code":"826",
"currency_country_minor_unit":"2",
"currency_country_name":"UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND",
"currency_name":"Pound Sterling",
"ds":"GB",
"edgar":null,
"fifa":"ENG,NIR,SCO,WAL",
"fips":"UK",
"gaul":"256",
"geoname_id":"2635167",
"id":"Europe/London",
"independent":true,
"ioc":"GBR",
"iso3166_1_alpha_2":"GB",
"iso3166_1_alpha_3":"GBR",
"itu":"G",
"languages":"en-GB,cy-GB,gd",
"location":"51.50833333333333, -0.12527777777777777",
"marc":"xxk",
"phone_prefix":"44",
"tld":".uk",
"un_m49_code":"826",
"wmo":"UK"
}
}
]
}
Understanding the JSON Fields
Field Name | Description | Example Values |
---|---|---|
class | Represents the type of data | “address_info” |
properties[*].datetime.date | The date | “08/23/2023” |
properties[*].datetime.date_time | Complete date and time | “08/23/2023 20:39:30” |
properties[*].datetime.date_time_txt | Date and time in text format | “Wednesday, August 23, 2023 20:39:30” |
properties[*].datetime.date_time_wti | Date and time with timezone information | “Wed, 23 Aug 2023 20:39:30 +0100” |
properties[*].datetime.date_time_ymd | Date and time in year-month-day format | “2023-08-23T20:39:30+0100” |
properties[*].datetime.day | Day of the month | “23” |
properties[*].datetime.day_abbr | Abbreviated day name | “Wed” |
properties[*].datetime.day_full | Full day name | “Wednesday” |
properties[*].datetime.day_wilz | Day of the month (same as day ) | “23” |
properties[*].datetime.hour_12_wilz | Hour in 12-hour format (zero-padded) | “08” |
properties[*].datetime.hour_12_wolz | Hour in 12-hour format | “8” |
properties[*].datetime.hour_24_wilz | Hour in 24-hour format (zero-padded) | “20” |
properties[*].datetime.hour_24_wolz | Hour in 24-hour format | “20” |
properties[*].datetime.hour_am_pm | AM/PM designation | “pm” |
properties[*].datetime.minutes | Minutes | “39” |
properties[*].datetime.month | Month in numeric format | “08” |
properties[*].datetime.month_abbr | Abbreviated month name | “Aug” |
properties[*].datetime.month_days | Day of the month (same as day ) | “23” |
properties[*].datetime.month_full | Full month name | “August” |
properties[*].datetime.month_wilz | Month in numeric format (same as month ) | “08” |
properties[*].datetime.seconds | Seconds | “30” |
properties[*].datetime.time | Time in hh:mm:ss format | “20:39:30” |
properties[*].datetime.week | Week number | “34” |
properties[*].datetime.year | Year in full | “2023” |
properties[*].datetime.year_abbr | Year abbreviated | “23” |
properties[*].formatted_address | The full formatted address | “Mayflower St, London SE16, UK” |
properties[*].location | Geographical coordinates | “51.5000232,-0.0551781” |
properties[*].timezone.capital | Capital city | “London” |
properties[*].timezone.continent | Continent | “EU” |
properties[*].timezone.country | Country name | “Britain (UK)” |
properties[*].timezone.country_code | Country code | “GB” |
properties[*].timezone.currency_alpha_code | Currency code in alphabetic format | “GBP” |
properties[*].timezone.currency_code | Numeric currency code | “826” |
properties[*].timezone.currency_country_minor_unit | Number of decimals in currency | “2” |
properties[*].timezone.currency_country_name | Full name of the country for the currency | “UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND” |
properties[*].timezone.currency_name | Currency name | “Pound Sterling” |
properties[*].timezone.ds | DS code | “GB” |
properties[*].timezone.edgar | EDGAR code (if available) | null |
properties[*].timezone.fifa | FIFA code | “ENG,NIR,SCO,WAL” |
properties[*].timezone.fips | FIPS code | “UK” |
properties[*].timezone.gaul | GAUL code | “256” |
properties[*].timezone.geoname_id | Geoname ID | “2635167” |
properties[*].timezone.id | Timezone ID | “Europe/London” |
properties[*].timezone.independent | Country independence status | true |
properties[*].timezone.ioc | IOC code | “GBR” |
properties[*].timezone.iso3166_1_alpha_2 | ISO 3166-1 alpha-2 country code | “GB” |
properties[*].timezone.iso3166_1_alpha_3 | ISO 3166-1 alpha-3 country code | “GBR” |
properties[*].timezone.itu | ITU code | “G” |
properties[*].timezone.languages | Languages spoken | “en-GB,cy-GB,gd” |
properties[*].timezone.location | Timezone coordinates | “51.50833333333333, -0.12527777777777777” |
properties[*].timezone.marc | MARC code | “xxk” |
properties[*].timezone.phone_prefix | Country phone prefix | “44” |
properties[*].timezone.tld | Top-level domain | “.uk” |
properties[*].timezone.un_m49_code | United Nations M49 code | “826” |
properties[*].timezone.wmo | World Meteorological Organization (WMO) country code | “UK” |
Note: The asterisk (*) in properties[*]
indicates that these fields can exist in multiple objects within the properties
array.
Feel free to consult this table for understanding each field that the API response may contain.
Step 3: Implement in Your Application
With the data parsed, it can now be utilized in a variety of applications:
- Delivery Services: Precisely target the delivery areas.
- Marketing: Conduct location-based marketing strategies.
- Analytics: Analyze the geographic distribution of your users.
Your application’s capabilities have just been greatly enhanced. Well done!
Conclusion
The EasyAPI Address Endpoint provides a robust solution for obtaining crucial address information. Equipped with this, you can more effectively tune your services, enhance user experience, and make data-driven decisions.
What's Next?
- Getting Started Guide: If you are new or need a refresher.
- IP Address Lookup Guide: Learn how to fetch additional information based on IP addresses.
- Timezone API Guide: Understand time zones for even more comprehensive data.
- API Docs: For an in-depth look at all functionalities, our API documentation is available.
Choose the Plan That Fits Your Need
Easy, transparent, and budget-friendly!
Free
$0
- 5.000 API calls
- Time zones
- Time zone comparison
- IP Address
- Address info
- Fast support
- Nearby places by IP
- Frequent database updates
- Multiple sources
- Commercial use
Commercial
$37/mo
- 500.000 API calls per month
- Time zones
- Time zone comparison
- IP Address
- Address info
- Fast support
- Nearby places by IP
- Frequent database updates
- Multiple sources
- Commercial use
Premium
$59/mo
- 2 million API calls per month
- Time zones
- Time zone comparison
- IP Address
- Address info
- Fast support
- Nearby places by IP
- Frequent database updates
- Multiple sources
- Commercial use
Business
$139/mo
- 6 million API calls per month
- Time zones
- Time zone comparison
- IP Address
- Address info
- Fast support
- Nearby places by IP
- Frequent database updates
- Multiple sources
- Commercial use