docs2.locationiq.com Open in urlscan Pro
2606:4700:20::ac43:60e4  Public Scan

Submitted URL: https://docs2.locationiq.com/
Effective URL: https://docs2.locationiq.com/docs
Submission Tags: phishingrod
Submission: On September 12 via api from DE — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

Jump to Content
Back to Website
GuidesAPI Explorer

--------------------------------------------------------------------------------

Back to WebsiteDashboard
Guides
Dashboard

GuidesAPI Explorer
Search
CTRL-K
Get startedQuickstartChoose your APIQuick Start GuidesConvert Coordinates To
AddressesConvert Addresses To CoordinatesPlot an address on a Static MapFind
Coffee Shops in New York CityFind Distance Between Two AddressesConvert Meeting
Time Across TimeZonesLocationIQ Access TokenPostman CollectionUsing Google
Sheets AddonAuthenticationGeocodingSearch / Forward GeocodingInteractive
PlaygroundAPI ReferenceReverse Geocoding APIInteractive PlaygroundAPI
ReferenceAutocomplete APINearby - Points of InterestPOI TagsTimezone
APIRoutingGeneral OptionsDirections APIOptimize APIMatrix APIMap Matching
APINearest APIMapsMapsExamplesStatic MapsOtherErrorsClient LibrariesBalance
APINotesParametersAddress detailsNormalize AddressCountry CodesAccept
LanguageZoom LevelsMatch Quality
All
Guides
API Explorer

START TYPING TO SEARCH…


GET STARTED

 * Quickstart
 * Choose your API
 * Quick Start Guides
   * Convert Coordinates To Addresses
   * Convert Addresses To Coordinates
   * Plot an address on a Static Map
   * Find Coffee Shops in New York City
   * Find Distance Between Two Addresses
   * Convert Meeting Time Across TimeZones
   * LocationIQ Access Token
   * Postman Collection
   * Using Google Sheets Addon
 * Authentication


GEOCODING

 * Search / Forward Geocoding
   * Interactive Playground
   * API Reference
 * Reverse Geocoding API
   * Interactive Playground
   * API Reference
 * Autocomplete API
 * Nearby - Points of Interest
   * POI Tags
 * Timezone API


ROUTING

 * General Options
 * Directions API
 * Optimize API
 * Matrix API
 * Map Matching API
 * Nearest API


MAPS

 * Maps
   * Examples
 * Static Maps


OTHER

 * Errors
 * Client Libraries
 * Balance API


NOTES

 * Parameters
   * Address details
   * Normalize Address
   * Country Codes
   * Accept Language
   * Zoom Levels
   * Match Quality


QUICKSTART

Start with LocationIQ in under 5 minutes

Suggest Edits

GET STARTED WITH LOCATIONIQ APIS

Welcome to the LocationIQ documentation guide. In these pages, you will learn
how to convert your address data to coordinates, your coordinate data to street
addresses, add a map to your website and more.

There are a number of ways to access our APIs, from no code to full code. Choose
what works for you:


DIRECT API INTEGRATION

Embed our services into your applications. Perfect for developers!


GOOGLE SHEETS PLUGIN

Geocode right in your spreadsheets. Simple, fast, and no code required!


POSTMAN COLLECTION

Start quickly with Postman. Easy testing and exploring of our API capabilities

--------------------------------------------------------------------------------


ACCESS OUR APIS DIRECTLY

This guide will walk you through making calls to our Forward Geocoding, Reverse
Geocoding, Maps and Static Maps APIs.


1. SIGN UP & GET YOUR API ACCESS TOKEN

Before you can start using our APIs, you'll need an API Access Token. Register
here if you don't have an API Access Token or follow this guide to get one.


2. CHOOSE YOUR ENDPOINT

We support two primary endpoints:

 * https://us1.locationiq.com/ - USA Endpoint
 * https://eu1.locationiq.com/ - Europe Endpoint

Choose the endpoint closer to your user base for faster response times.

--------------------------------------------------------------------------------


3. FORWARD GEOCODING: CONVERT AN ADDRESS TO COORDINATES

Learn how to convert a street address to coordinates with a practical example
using the Statue of Liberty in New York.


MAKING THE API CALL

Search for "Statue of Liberty, New York" and find its coordinates by calling the
Forward Geocoding API with this URL:

HTTPcURL
https://us1.locationiq.com/v1/search?key=YOUR_ACCESS_TOKEN&q=Statue%20of%20Liberty,%20New%20York&format=json


curl "https://us1.locationiq.com/v1/search?key=YOUR_ACCESS_TOKEN&q=Statue%20of%20Liberty,%20New%20York&format=json"


You can also click here to make this API call directly from your browser.

Be sure to replace YOUR_ACCESS_TOKEN with the Access Token you obtained in the
previous step.


SAMPLE RESPONSE

If all goes well, you'll receive a response in JSON format, which will look
something like:

JSON
[
    {
        "place_id": "115589658",
        "licence": "https://locationiq.com/attribution",
        "lat": "40.689253199999996",
        "lon": "-74.04454817144321",
        "display_name": "Statue of Liberty, Flagpole Plaza, Manhattan Community Board 1, Manhattan, New York County, New York, New York, 10004, USA",
       ...
    },
    ...
]


The key details here are the lat and lon values, which represent the latitude
and longitude of the Statue of Liberty.

If you supplied an invalid Access Token, you'll receive this response instead.

JSON
{"error":"Invalid key"}


Read more about the Forward Geocoding API: Detailed Guide | Playground | API
Reference

--------------------------------------------------------------------------------


4. REVERSE GEOCODING: CONVERT COORDINATES TO AN ADDRESS

Find out how to discover a location's details using only its coordinates.

We have a set of coordinates at hand: latitude 48.8584 and longitude 2.2945.
Let's find out what notable place these coordinates point to!


MAKING THE API CALL

Use the following URL to make the API call to the Reverse Geocoding API:

HTTPcURL
https://us1.locationiq.com/v1/reverse?key=YOUR_ACCESS_TOKEN&lat=48.8584&lon=2.2945&format=json


curl "https://us1.locationiq.com/v1/reverse?key=YOUR_ACCESS_TOKEN&lat=48.8584&lon=2.2945&format=json"


For a hands-on experience, click here to make the API call right from your
browser. Just replace YOUR_ACCESS_TOKEN with your token.


SAMPLE RESPONSE

If all goes well, you'll receive a response in JSON format, which will look
something like:

JSON
{
    "place_id": "123456",
    "licence": "https://locationiq.com/attribution",
    "lat": "48.8584",
    "lon": "2.2945",
    "display_name": "Eiffel Tower, Avenue Anatole France, Quartier du Gros-Caillou, Paris, Île-de-France, Metropolitan France, 75007, France",
    ...
}


Surprise! The coordinates point to the iconic Eiffel Tower in Paris, France. The
display_name value gives us the full address of this landmark.

Read more about the Reverse Geocoding API: Detailed Guide | Playground | API
Reference

--------------------------------------------------------------------------------


5. VISUALIZE ON A MAP

Now that we've unveiled our location mystery as the famous Eiffel Tower, let's
bring it to life on a dynamic map.

Follow these steps to craft a web page with an interactive map and a pinpoint
marker.

 1. Add CSS and JS
    
    In the <head> section of your HTML file, add the following lines to include
    CSS and JavaScript files:
    
    HTML
    <script src="https://tiles.locationiq.com/v3/libs/maplibre-gl/1.15.2/maplibre-gl.js"></script>
    <link href="https://tiles.locationiq.com/v3/libs/maplibre-gl/1.15.2/maplibre-gl.css" rel="stylesheet" />
    

 2. Create a Map Container
    
    In the <body> section, create a container for your map:
    
    HTML
    <div id='map' style='width: 400px; height: 300px;'></div>
    

 3. Initialize the Map and Add a Marker
    
    Add the following before the end of the </body> section, to initialize the
    map and add a marker at the Eiffel Tower's coordinates:
    
    JavaScript
    locationiqKey = 'YOUR_ACCESS_TOKEN';
    var map = new maplibregl.Map({
          container: 'map',
          style: 'https://tiles.locationiq.com/v3/streets/vector.json?key='+locationiqKey,
          center: [2.2945, 48.8584],
          zoom: 14
    });
                
    new maplibregl.Marker()
        .setLngLat([2.2945, 48.8584])
        .addTo(map);
    
    
    Replace YOUR_ACCESS_TOKEN with your LocationIQ access token.

 4. View your Map
    
    Open the HTML file in a browser and you should see a map centered on the
    Eiffel Tower with a marker indicating its exact location. Here's a demo of
    how it would look along with the full source:

undefined

Read more about the Maps API: Detailed Guide | More Samples

--------------------------------------------------------------------------------


6. CREATE A STATIC MAP

Static maps are perfect for instances where you need a simple, non-interactive
representation of a location.

In this step, we will generate a static map of a renowned landmark, the
Colosseum in Rome, Italy, known worldwide for its historical significance and
architectural grandeur.

To create a static map with a marker at the Colosseum, call this URL:

URL
https://maps.locationiq.com/v3/staticmap?key=YOUR_ACCESS_TOKEN&center=41.8902,12.4924&zoom=17&size=400x400&markers=icon:large-red-cutout|41.8902,12.4924


Or embed it in HTML:

HTML
<img src="https://maps.locationiq.com/v3/staticmap?key=YOUR_ACCESS_TOKEN&center=41.8902,12.4924&zoom=17&size=400x400&markers=icon:large-red-cutout|41.8902,12.4924" alt="Static Map of the Colosseum">


You can also click here to view the Static Map directly in your browser. Replace
YOUR_ACCESS_TOKEN with your token.


SAMPLE RESPONSE

This will generate a static map with the Colosseum at its center. You can embed
this image in travel blogs, educational materials, or even in a travel itinerary
to provide a visual reference of the location.

Read more about the Static Maps API: Detailed Guide

--------------------------------------------------------------------------------


MORE QUICK-START GUIDES

Find Coffee Shops in New York City

Find Distance Between Two Addresses

Convert Meeting Time Across TimeZones

Updated 6 minutes ago

--------------------------------------------------------------------------------

What’s Next

 * Choose your API

Did this page help you?
Yes
No
 * Table of Contents
 * * Get Started with LocationIQ APIs
   * Access our APIs directly
     * 1. Sign Up & Get your API Access Token
     * 2. Choose Your Endpoint
     * 3. Forward Geocoding: Convert an Address to Coordinates
     * 4. Reverse Geocoding: Convert Coordinates to an Address
     * 5. Visualize on a Map
     * 6. Create a Static Map
     * More Quick-Start Guides