URL Lookup API
The URL Lookup API provides location information for any valid URL or domain name.
/v1/urllookup GET
https://api.api-ninjas.com/v1/urllookup
Returns the location of the IP address hosting the URL domain. The response contains both the geographical coordinates (latitude/longitude) as well as the city and country.
Parameters
- urlrequired- Valid URL to check. It supports schemes (e.g. - http://example.com) as well as schemeless (e.g.- example.com) formats.
Headers
- X-Api-Keyrequired- API Key associated with your account. 
Sample Request Live Demo!
url
https://api.api-ninjas.com/v1/urllookup?url=example.comHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "is_valid": true,
  "country": "United States",
  "country_code": "US",
  "region_code": "MA",
  "region": "Massachusetts",
  "city": "Norwell",
  "zip": "02061",
  "lat": 42.1591,
  "lon": -70.8163,
  "timezone": "America/New_York",
  "isp": "MCI Communications Services, Inc. d/b/a Verizon Business",
  "url": "example.com"
}Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/urllookup?url=https://example.com" \
  -H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.