@tpmjs/tools-extract-meta
Extract meta tags from HTML pages including title, description, Open Graph, and Twitter Cards
Module not found "https://esm.sh/node:sqlite?target=denonext".
at [0m[36mhttps://esm.sh/undici@7.16.0?target=denonext[0m:[0m[33m2[0m:[0m[33m8[0mLast checked: 1/1/2026, 8:18:32 AM
Test @tpmjs/tools-extract-meta (extractMetaTool) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-extract-metapnpm add @tpmjs/tools-extract-metayarn add @tpmjs/tools-extract-metabun add @tpmjs/tools-extract-metadeno add npm:@tpmjs/tools-extract-metaimport { extractMetaTool } from '@tpmjs/tools-extract-meta';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { extractMetaTool } from '@tpmjs/tools-extract-meta';
const result = await generateText({
model: openai('gpt-4o'),
tools: { extractMetaTool },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
urlstringThe URL to extract meta tags from
Try to auto-extract schema from the package
Extract meta tags from HTML pages including title, description, Open Graph, and Twitter Cards.
npm install @tpmjs/tools-extract-meta
import { extractMetaTool } from '@tpmjs/tools-extract-meta'; // Use with AI SDK const result = await extractMetaTool.execute({ url: 'https://example.com', }); console.log(result.title); // 'Example Domain' console.log(result.description); // 'This domain is for use in illustrative examples...' console.log(result.ogTags); // { title: '...', image: '...', ... } console.log(result.twitterTags); // { card: 'summary', ... }
url (string, required): The URL to extract meta tags from (must be http or https)Returns an ExtractMetaResult object:
{ title: string | null; // Page title (from <title> or og:title) description: string | null; // Meta description canonical: string | null; // Canonical URL ogTags: Record<string, string>; // All Open Graph tags (without 'og:' prefix) twitterTags: Record<string, string>; // All Twitter Card tags (without 'twitter:' prefix) metadata: { url: string; // Original URL fetchedAt: string; // ISO timestamp contentType: string; // Content-Type header hasOpenGraph: boolean; // Whether page has OG tags hasTwitterCard: boolean; // Whether page has Twitter Card tags }; }
Common OG tags extracted (keys without og: prefix):
title - Open Graph titledescription - Open Graph descriptionimage - Open Graph image URLurl - Open Graph canonical URLtype - Content type (article, website, etc.)site_name - Website namelocale - Content localeCommon Twitter tags extracted (keys without twitter: prefix):
card - Card type (summary, summary_large_image, etc.)title - Twitter card titledescription - Twitter card descriptionimage - Twitter card image URLsite - Twitter username for websitecreator - Twitter username for content creatorMIT
Downloads/month
0
Quality Score