Metadata-Version: 2.5
Name: langchain-webmetadata-extractor
Version: 0.1.0
Summary: LangChain tools for the Web Metadata, OpenGraph & Contact Extractor API — give your agent URL-to-structured-data extraction, AI-ready Markdown, contact discovery, and SEO auditing.
Project-URL: Homepage, https://github.com/JosejuX/rapidapi-metadata-extractor
Project-URL: RapidAPI Listing, https://rapidapi.com/josejuanjocoding/api/web-metadata-and-contact-extractor
Project-URL: PyPI SDK, https://pypi.org/project/webmetadata-extractor/
Author-email: Juanjo <josejuanjo.coding@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,langchain,langchain-tool,metadata-extractor,rag,seo,web-scraping
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: langchain-core>=0.2
Requires-Dist: pydantic>=2
Requires-Dist: webmetadata-extractor>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: responses>=0.23; extra == 'dev'
Description-Content-Type: text/markdown

# langchain-webmetadata-extractor

LangChain tools for the [Web Metadata, OpenGraph & Contact Extractor API](https://rapidapi.com/josejuanjocoding/api/web-metadata-and-contact-extractor) — give an agent the ability to turn any URL into structured web intelligence, clean Markdown for RAG, contact signals for lead-gen, or a graded SEO audit.

```bash
pip install langchain-webmetadata-extractor
```

## Quick start

Get a free API key on [RapidAPI](https://rapidapi.com/josejuanjocoding/api/web-metadata-and-contact-extractor) (1,000 requests/month, no credit card required).

```python
from langchain_webmetadata_extractor import get_tools

tools = get_tools(api_key="YOUR_RAPIDAPI_KEY")
# or leave api_key out and set the WEBMETADATA_API_KEY environment variable instead

agent = create_react_agent(llm, tools)  # or bind_tools(tools), or any LangGraph node
```

You can also import and use tools individually:

```python
from langchain_webmetadata_extractor import WebMarkdownTool

reader = WebMarkdownTool(api_key="YOUR_RAPIDAPI_KEY")
print(reader.run("https://example.com"))
```

## Tools included

| Tool | Use it when the agent needs to... |
|---|---|
| `WebMetadataExtractTool` | Get a broad, all-in-one picture of a page (SEO, contacts, tech stack, security, links) |
| `WebMarkdownTool` | Ingest a page's actual content into a RAG pipeline as clean Markdown |
| `WebContactsTool` | Find public emails/phones/social links for outreach or lead-gen workflows |
| `WebSEOAuditTool` | Grade a page's SEO with a score, warnings, and readability metrics |

Every tool supports both sync (`.run()` / `._run()`) and async (`.arun()` / `._arun()`) execution, and returns a JSON string — API errors come back as `{"error": true, "status_code": ..., "detail": ...}` instead of raising, so an agent loop can react to them without crashing.

## Configuration

Pass `api_key` explicitly per tool, or set it once via the `WEBMETADATA_API_KEY` environment variable and omit it everywhere:

```bash
export WEBMETADATA_API_KEY=your-rapidapi-key
```

## Links

- [Python SDK this wraps](https://pypi.org/project/webmetadata-extractor/) (`webmetadata-extractor`)
- [Full API documentation](https://github.com/JosejuX/rapidapi-metadata-extractor)
- [Live interactive demo](https://rapidapi-metadata-extractor.onrender.com) — no signup needed

## License

MIT
