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.

/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

  • 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
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
1 2 3 4 5 6 7 8 9 10 11 12 { "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 3 4 5 6 7 8 import requests api_url = 'https://api.api-ninjas.com/v1/webpage?url=https://example.com' response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'}) if response.status_code == requests.codes.ok: print(response.text) else: print("Error:", response.status_code, response.text)

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.