POST /web_meta_tags • Credits: 1 credit per call
Meta Tags Extractor returns the Open Graph tags, the Twitter Card tags and the SEO meta tags of one public web page. The response holds the page title, the description, the canonical URL, the favicon and the hreflang links. Each call costs 1 credit.
What does Meta Tags Extractor do?
A link preview card, an SEO audit and a content index all need the same data: the meta tags in the page head. Meta Tags Extractor returns that data as structured JSON. The endpoint fetches the page over HTTP and parses the <head> element. It sorts every tag into four groups: Open Graph, Twitter Card, SEO and everything else. Meta Tags Extractor runs no browser. Meta Tags Extractor is one of the specialized endpoints in the RichAPI web scraper family.
Which endpoint does Meta Tags Extractor use?
Method:
POSTURL:
https://api.richapi.ai/api/v1/web_meta_tagsAuthentication:
x-api-keyheaderResponse: Synchronous JSON
Credits: 1 credit per call
How to send a Meta Tags Extractor request
Copy your API key from the RichAPI dashboard.
Set the
urlparameter to the full page URL.Send a
POSTrequest tohttps://api.richapi.ai/api/v1/web_meta_tags.Send the API key in the
x-api-keyheader.Read the
data.og,data.twitteranddata.seoobjects from the response.
CAUTION: Each Meta Tags Extractor call costs 1 credit. A cached result also costs 1 credit.
cURL
curl -X POST https://api.richapi.ai/api/v1/web_meta_tags
-H "x-api-key: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"url": "https://stripe.com",
"cache": true
}'
Python
import requests
response = requests.post(
"https://api.richapi.ai/api/v1/web_meta_tags",
headers={"x-api-key": "YOUR_API_KEY"},
json={
"url": "https://stripe.com",
"cache": True,
},
timeout=60,
)
response.raise_for_status()
print(response.json())
Node.js
const response = await fetch("https://api.richapi.ai/api/v1/web_meta_tags", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://stripe.com",
cache: true,
}),
});
const data = await response.json();
console.log(data);
Which parameters does Meta Tags Extractor accept?
Parameter | Type | Required | Default | Description |
| string | Yes | None | The full HTTP or HTTPS URL of the page to read. The maximum length is 2048 characters. |
| boolean | No |
| Set to |
| boolean | No |
| Set to |
What does Meta Tags Extractor return?
The block below is an example response for https://stripe.com. The values are illustrative.
{
"data": {
"og": {
"title": "Stripe | Financial Infrastructure to Grow Your Revenue",
"description": "Stripe powers online and in-person payment processing for businesses of every size.",
"image": "https://images.stripeassets.com/fzn2n1nzq965/og-home.png",
"url": "https://stripe.com/",
"type": "website",
"site_name": "Stripe",
"locale": "en_US",
"extra": {
"video": "https://stripe.com/media/home-hero.mp4"
}
},
"twitter": {
"card": "summary_large_image",
"site": "@stripe",
"creator": "@stripe",
"title": "Stripe | Financial Infrastructure to Grow Your Revenue",
"description": "Stripe powers online and in-person payment processing for businesses of every size.",
"image": "https://images.stripeassets.com/fzn2n1nzq965/twitter-card.png",
"extra": {
"label1": "Read time"
}
},
"seo": {
"title": "Stripe | Financial Infrastructure to Grow Your Revenue",
"description": "Stripe powers online and in-person payment processing for businesses of every size.",
"canonical": "https://stripe.com/",
"robots": "index, follow",
"viewport": "width=device-width, initial-scale=1",
"charset": "utf-8",
"author": "Stripe",
"keywords": "payments, payment processing, online payments",
"language": "en"
},
"favicon": "https://stripe.com/favicon.ico",
"hreflang": [
{ "lang": "en-US", "url": "https://stripe.com/" },
{ "lang": "fr-FR", "url": "https://stripe.com/fr-fr" }
],
"other": {
"theme-color": "#635bff",
"generator": "Next.js"
}
},
"meta": {
"cache_hit": false,
"execution_time_ms": 412,
"quality_warning": null
}
}
Which fields does the Meta Tags Extractor response hold?
Field | Type | Description |
| object | The Open Graph tags of the page. |
| object | The Twitter Card tags of the page. |
| object | The standard SEO meta tags of the page. |
| string | The favicon URL of the page. If the page declares no icon, the value is |
| array of objects | The alternate language links. Each entry holds a |
| object | Every remaining meta tag, as a name to content map. |
| boolean | The cache status of the result. The value |
| integer | The time that the call took, in milliseconds. |
| string | A warning about the extraction, or |
Which Open Graph fields does Meta Tags Extractor return?
The data.og object holds the tags whose property starts with og:. Every named field is a string or null.
Field | Type | Source tag |
| string |
|
| string |
|
| string |
|
| string |
|
| string |
|
| string |
|
| string |
|
| object | Every other |
Which Twitter Card fields does Meta Tags Extractor return?
The data.twitter object holds the tags whose property starts with twitter:. Every named field is a string or null.
Field | Type | Source tag |
| string |
|
| string |
|
| string |
|
| string |
|
| string |
|
| string |
|
| object | Every other |
Which SEO fields does Meta Tags Extractor return?
The data.seo object holds the standard head tags of the page. Every field is a string or null.
Field | Type | Source |
| string | The |
| string | The |
| string | The |
| string | The |
| string | The |
| string | The |
| string | The |
| string | The |
| string | The |
How do you build a link preview with Meta Tags Extractor?
A link preview card needs a title, a description and an image. Meta Tags Extractor returns all three in one call.
Send the page URL as the
urlparameter.Read
data.og.title. If the value isnull, fall back todata.seo.title.Read
data.og.description. If the value isnull, fall back todata.seo.description.Read
data.og.image. If the value isnull, fall back todata.twitter.image.Read
data.faviconfor the site icon.
This order matches the order that Slack, LinkedIn, X and iMessage use.
How do you audit SEO tags with Meta Tags Extractor?
An SEO audit checks that each page declares the correct head tags. Meta Tags Extractor returns those tags for one URL per call.
Send one request for each page URL that you want to audit.
Check that
data.seo.titleis notnulland is shorter than 60 characters.Check that
data.seo.descriptionis notnulland is shorter than 160 characters.Check that
data.seo.canonicalmatches the URL that you sent.Check that
data.seo.robotsdoes not holdnoindex.Check that
data.og.imageanddata.twitter.cardare notnull.
What happens on a page with no meta tags?
Meta Tags Extractor returns status 200 for a page with no meta tags. The og, twitter and seo objects are present, but every field inside them is null. The favicon field is null, the hreflang array is empty and the other object is empty. The example below shows that response.
{
"data": {
"og": {
"title": null,
"description": null,
"image": null,
"url": null,
"type": null,
"site_name": null,
"locale": null,
"extra": {}
},
"twitter": {
"card": null,
"site": null,
"creator": null,
"title": null,
"description": null,
"image": null,
"extra": {}
},
"seo": {
"title": null,
"description": null,
"canonical": null,
"robots": null,
"viewport": null,
"charset": null,
"author": null,
"keywords": null,
"language": null
},
"favicon": null,
"hreflang": [],
"other": {}
},
"meta": {
"cache_hit": false,
"execution_time_ms": 188,
"quality_warning": null
}
}
CAUTION: An empty result still costs 1 credit. RichAPI charges the credit on every 200 response. Make sure that data.seo.title or data.og.title is not null before you store the result.
How long does Meta Tags Extractor cache a page?
Meta Tags Extractor caches each page for 6 hours. If you set cache to true, the API returns a cached result from inside that window. The API then sets meta.cache_hit to true. To force a fresh fetch, set cache_bust to true. A cached call and a fresh call both cost 1 credit.
When do you use Meta Tags Extractor instead of Web Scraper?
When you want the meta tags of a page, use Meta Tags Extractor. When you want the page content itself, use Web Scraper. Web Scraper returns the full HTML and markdown, and it runs the page JavaScript. Meta Tags Extractor returns parsed head tags only, and it runs no browser.
Endpoint | What the endpoint returns | JavaScript | Credits |
| The Open Graph, Twitter Card and SEO tags of one page. | No | 1 per call |
| The full page as HTML, markdown and title. | Yes | 1 per call |
| The JSON-LD structured data blocks of one page. | No | 1 per call |
| One combined report for a domain, including the meta tags. | Mixed | 5 per call |
If you need five or more signals for one domain, send one website_intelligence call instead. That call covers the meta tags, the tech stack, the pixels and the social links.
How much does Meta Tags Extractor cost?
Meta Tags Extractor costs 1 credit per call. 1 credit costs $0.02 on the 1,000 and 5,000 credit packs. Larger packs cost less per credit. The credit count does not change with the page size or with the number of tags that the page declares.
Calls | Credits | Cost |
1 | 1 | $0.02 |
100 | 100 | $2.00 |
1,000 | 1,000 | $20.00 |
10,000 | 10,000 | $200.00 |
Which errors can Meta Tags Extractor return?
Status | Meaning | What to do |
| The request body failed validation. | Correct the parameter that the message names. Send a full HTTP or HTTPS URL. |
| The API key is missing, wrong or revoked. | Send a valid key in the |
| The organization has no credits left, or the team reached its monthly spend limit. | Buy credits in the RichAPI dashboard. |
|
| Call |
| The endpoint name is wrong. | Send the request to |
| The request used a method other than | Send the request again with the |
| The service could not process a value, for example a URL that does not start with | Send a full public HTTP or HTTPS URL. |
| Too many requests. | Read the |
| The API failed. | Send the request again. If the failure repeats, write to [email protected]. |
| The target page returned a | Check that the URL opens in a browser. Then send the request again. |
| The target page took too long. | Send the request again. |
RichAPI charges no credit for a 400, 401, 402, 403, 404, 405, 422, 429, 500, 502 or 504 response.
Frequently asked questions
Does Meta Tags Extractor run JavaScript?
No. Meta Tags Extractor fetches the raw HTML over HTTP and parses the <head> element. If a page writes its meta tags with JavaScript, use Web Scraper instead.
Does Meta Tags Extractor return the Open Graph image?
Yes. The data.og.image field holds the og:image URL. The data.twitter.image field holds the twitter:image URL, which many sites set to a different file.
What does Meta Tags Extractor return for a page with no meta tags?
Meta Tags Extractor returns status 200 with every tag field set to null. The hreflang array and the other object are empty, and the call still costs 1 credit.
Can Meta Tags Extractor read a page behind a login?
No. Meta Tags Extractor accepts no login credentials and no cookies. It reads only a page that a public visitor can open.
Can Meta Tags Extractor reach an internal or private address?
No. Meta Tags Extractor rejects a URL that points to a private network address or to an internal host. Send a public HTTP or HTTPS URL.
How do I get a meta tag that is not in the og, twitter or seo group?
Read the data.other object. It holds every remaining meta tag as a name to content map, for example theme-color and generator.
How many URLs can one Meta Tags Extractor call cover?
One. Each call reads one URL and costs 1 credit. To cover a whole website, send a Sitemap Extractor request first. Then send one Meta Tags Extractor call per URL.
