Meta Tags API

Meta Tags API

Scrapes, parses and retrieves META tags of any URL as well as many other useful information.
Free Plan $0.00 Monthly Subscribe
150 Requests / Monthly
Free for Lifetime
No Credit Card Required
MOST POPULAR
Starter Plan $9.99 Monthly Subscribe
300,000 Requests / Monthly
Standard Support
Ultra-fast and reliable
No need to deal with HTML parsing
Rotating Proxy support bundled in
Works with all programming languages and frameworks
Pro Plan $39.99 Monthly Subscribe
1,500,000 Requests / Monthly
Standard Support
Ultra-fast and reliable
No need to deal with HTML parsing
Rotating Proxy support bundled in
Works with all programming languages and frameworks
Custom Plan Volume Monthly Contact Us
Any requests volume you need
Ultra-fast and reliable
No need to deal with HTML parsing
Rotating Proxy support bundled in
Works with all programming languages and frameworks

Meta tags are hidden tags that provide a summary about your web page to the search engines. While meta tags are invisible in the web page itself, they can be read by search engines and web crawlers. You can also see the meta tags in the web page if you know how to inspect the HTML source.

Search engines use meta tags information to understand how they should display the page information in the search results. Also, that information tells the web browser how to display it to the end user. Moreover, meta tags are crucial for rankings in the search results and must be used correctly for SEO.

Do Meta Tags Help with SEO

The SEO community is definitive on this topic. The most important meta tag for ranking is your title tag. A good title should help you to rank for a keyword and makes people want to click on it. With click-through rates increasing, your ranking in the search results will increase as well.

No other meta tags other than title affect SEO rankings but...that's not to say they're unimportant!

Title: Very Important.
Description: Less Important.
Image: Moderately Important.
Keyword: Negative Importance.

How this API works

The most basic functionality of Meta Tags API is to scrape the provided URL and parse the response text immediately in order to detect all the meta tags available.

The API response provides below information:

  • Title tag value
  • OpenGraph Meta Tags
  • Favicon Image URL
  • Canonical URL
  • IP Address of the remote site, as resolved by DNS server
  • HTML size of the remote document (in bytes)
  • Fetch_duration: How many milliseconds did it take to fetch the page?
  • Number of Scripts: How many JS documents are linkedin in the page
  • Number of Stylesheets: How many CSS documents are linkedin in the page

Rotating Proxy Support

Meta Tags API allows you to utilize thousands of different IP addresses to route your requests through. Rotating proxies are essential to overcome IP fingerprinting and rate-limit problems for web scraping. If for any reason you may need this functionality, Meta Tags API features a query parameter called "proxy". Just set the “proxy” parameter to true and your requests will automatically be using rotating proxies and your scraping requests will arrive from millions of different IP addresses all around the world.

Sample code

Following is a sample cURL call for parsing the meta tags of apilayer.com web site.


curl --location --request \
GET 'https://api.apilayer.com/meta_tags?url=apilayer.com&proxy=true' \
--header 'apikey: YOUR API KEY'

And the result of this call is below:


{
    "meta_tags": [
        {
            "charset": "utf-8"
        },
        {
            "name": "viewport",
            "content": "width=device-width, initial-scale=1, shrink-to-fit=no"
        },
        {
            "name": "description",
            "content": "Highly curated API marketplace with a focus on reliability and scalability. Allows software developers building the next big thing much easier and faster."
        },
        {
            "name": "twitter:card",
            "content": "summary"
        },
        {
            "name": "twitter:site",
            "content": "@apilayer"
        },
        {
            "name": "twitter:creator",
            "content": "@apilayer"
        },
        {
            "property": "og:title",
            "content": "APILayer | Hassle free API marketplace"
        },
        {
            "property": "og:description",
            "content": "API marketplace and ready to run app backends for your mobile app and website."
        },
        {
            "property": "og:image",
            "content": "https://assets.apilayer.com/logo/square_large_bg.png"
        }
    ],
    "title": "APILayer - Hassle free API marketplace",
    "favicon": "https://assets.apilayer.com/favicon.ico",
    "canonical": "https://apilayer.com",
    "host": {
        "ip_address": "104.26.10.107",
        "domain": "apilayer.com",
        "scheme": "http"
    },
    "stats": {
        "bytes": 47323,
        "fetch_duration": 2530.836,
        "number_of_scripts": 31,
        "number_of_stylesheets": 5
    }
}

Meta Tags API Reference

This API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Just Getting Started?

Check out our development quickstart guide.

Authentication

Meta Tags API uses API keys to authenticate requests. You can view and manage your API keys in the Accounts page.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

All requests made to the API must hold a custom HTTP header named "apikey". Implementation differs with each programming language. Below are some samples.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Endpoints

Retrieves the meta tags of the provided URL

Parameters

url (required)

URL to fetch meta tags

Location: Query, Data Type: string

proxy (optional)

Set this if you need rotating proxies. (true/false)

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Retrieves the meta tags of the provided URL at the HTTP body

Parameters

body (required)

URL to fetch meta tags

Location: Body, Data Type: string

proxy (optional)

Set this if you need rotating proxies. (true/false)

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Rate Limiting

Each subscription has its own rate limit. When you become a member, you start by choosing a rate limit that suits your usage needs. Do not worry; You can upgrade or downgrade your plan at any time. For this reason, instead of starting with a larger plan that you do not need, we can offer you to upgrade your plan after you start with "free" or "gold plan" options and start using the API.

When you reach a rate limit (both daily and monthly), the service will stop responding and returning the HTTP 429 response status code (Too many requests) for each request with the following JSON string body text.

{
"message":"You have exceeded your daily\/monthly API rate limit. Please review and upgrade your subscription plan at https:\/\/apilayer.com\/subscriptions to continue."
}

A reminder email will be sent to you when your API usage reaches both 80% and 90%, so that you can take immediate actions such as upgrading your plan in order to prevent your application using the API from being interrupted.

You can also programmatically check your rate limit yourself. As a result of each request made to the APILayer, the following 4 fields provide you with all the necessary information within the HTTP Headers.

x-ratelimit-limit-month: Request limit per month
x-ratelimit-remaining-month: Request limit remaining this month
x-ratelimit-limit-day: Request limit per day
x-ratelimit-remaining-day: Request limit remaining today

You can contact our support unit if you need any assistance with your application regarding to handle the returned result by looking at the header information.

Error Codes

APILayer uses standard HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate a clientside error, which means that failed given the information provided (e.g., a missing parameter, unauthorized access etc.). Codes in the 5xx range indicate an error with APILayer's servers (normally this should'nt happen at all).

If the response code is not 200, it means the operation failed somehow and you may need to take an action accordingly. You can check the response (which will be in JSON format) for a field called 'message' that briefly explains the error reported.

Status Code Explanation
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid API key provided.
404 - Not Found The requested resource doesn't exist.
429 - Too many requests API request limit exceeded. See section Rate Limiting for more info.
5xx - Server Error We have failed to process your request. (You can contact us anytime)

You can always contact for support and ask for more assistance. We'll be glad to assist you with building your product.