NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

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.

(4.3)

From 5,841 users

2,000+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
272ms288ms329ms485ms1138ms

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

  • url  required

    URL to retrieve information from.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • url

    URL to retrieve information from.

  • domain

    Domain name of the URL.

  • url_path

    Path of the URL.

  • url_parameters

    Parameters of the URL.

  • page_title

    Title of the web page.

  • page_description

    Description of the web page.

  • meta_tags

    Meta tags of the web page.

  • favicon

    Favicon of the web page.

Sample Request Live Demo!

url

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.com

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    url:"https://example.com",
    domain:"example.com",
    url_path:"",
    url_parameters:{},
    page_title:"Example Domain",
    page_description:"",
    meta_tags:{
      viewport:"width=device-width, initial-scale=1"
    },
    favicon:""
}

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

  • 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.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • 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.
  • 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.
  • A single GET request to /v1/webpage with the url parameter returns the parsed domain, url_path, url_parameters, page_title, page_description, a meta_tags object, and the page's favicon. See the full list of API Ninjas endpoints for related tools.
  • All web page metadata is retrieved live by loading and parsing the target page at request time, so the page_title, page_description, and meta_tags reflect 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.
  • 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.
  • Yes, the API parses the supplied url and breaks it into its domain, url_path, and a url_parameters object containing the query string values. To classify or check the reputation of a URL instead, see the URL Lookup API.