URL Lookup API
The URL Lookup API provides location information for any valid URL or domain name.
From 7,993 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 228ms | 259ms | 288ms | 610ms | 1005ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/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
urlrequiredValid URL to check. It supports schemes (e.g.
http://example.com) as well as schemeless (e.g.example.com) formats. For top-level domains other than .com, a premium subscription is required.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
urlThe URL that was looked up.
countryCountry name.
country_code2-letter ISO 3166 alpha-2 country code.
regionState, province, or administrative region name.
region_codeRegion code (e.g., state code).
cityCity name.
zipZIP or postal code.
latLatitude coordinate.
lonLongitude coordinate.
timezoneTimezone (e.g.,
America/New_York).ispInternet Service Provider name.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/urllookup?url=example.comHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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.
Frequently Asked Questions
Can I use the URL Lookup API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the URL Lookup API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the URL Lookup API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the URL Lookup API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.What information does the URL Lookup API return for a domain?
It resolves the URL to the IP address hosting it and returns geolocation details includingcountry,country_code,region,region_code,city,zip,lat,lon,timezone, and the hostingisp. If you need the same data starting from an IP address instead of a URL, try the IP Lookup API.What URL formats does the url parameter accept?
The requiredurlparameter accepts both full URLs with a scheme (e.g.http://example.com) and schemeless domains (e.g.example.com). Note that looking up top-level domains other than .com requires a premium subscription.What are some use cases for the URL Lookup API?
It is useful for fraud detection, content localization, and identifying where a website is hosted using itscity,country, andispfields. For related domain intelligence you can pair it with the DNS Lookup API or the Whois API.