Webpage API
The Webpage API provides services to retrieve URL information and web page metadata from any website URL. All web page metadata is retrieved live from the URL by loading and parsing the page.
To retrieve web page text, use the Web Scraper API instead.
From 5,841 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 272ms | 288ms | 329ms | 485ms | 1138ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
/v1/webpage GET
https://api.api-ninjas.com/v1/webpage
Returns the URL information and web page metadata from a given URL.
Parameters
urlrequiredURL to retrieve information from.
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.
urlURL to retrieve information from.
domainDomain name of the URL.
url_pathPath of the URL.
url_parametersParameters of the URL.
page_titleTitle of the web page.
page_descriptionDescription of the web page.
meta_tagsMeta tags of the web page.
faviconFavicon of the web page.
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/webpage?url=https://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/webpage?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 Webpage API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Webpage 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 Webpage 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 Webpage 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 metadata does the Webpage API return for a URL?
A single GET request to/v1/webpagewith theurlparameter returns the parseddomain,url_path,url_parameters,page_title,page_description, ameta_tagsobject, and the page'sfavicon. See the full list of API Ninjas endpoints for related tools.Is the metadata cached or fetched live?
All web page metadata is retrieved live by loading and parsing the target page at request time, so thepage_title,page_description, andmeta_tagsreflect the page's current state rather than a cached snapshot. If a fetch fails you will get an error response instead of a JSON object.How do I get the full text content of a page instead of just its metadata?
The Webpage API only returns URL information and metadata; to extract the actual body text of a page, use the Web Scraper API instead. For domain-level registration details, the Whois API and Domain API are better fits.Can I pass a URL that includes query parameters?
Yes, the API parses the suppliedurland breaks it into itsdomain,url_path, and aurl_parametersobject containing the query string values. To classify or check the reputation of a URL instead, see the URL Lookup API.