Metadata-Version: 2.4
Name: nexract
Version: 1.0.0
Summary: Web extraction API for AI agents and LLMs
Home-page: https://www.nexract.ai
Author: Nexract
Author-email: support@nexract.ai
Project-URL: Documentation, https://www.nexract.ai/integrations.html
Project-URL: Source, https://github.com/Aromyla/Nexract
Keywords: web scraping,web extraction,ai agent,llm,openai,gpt,claude,langchain
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Nexract

Web extraction API for AI agents and LLMs.

Give your AI agent the ability to read any webpage — one API call, clean markdown output.

```bash
pip install nexract
```

## Quick Start

```python
from nexract import Nexract

client = Nexract(api_key="SK-LAB-YOUR-KEY")
result = client.extract("https://example.com/article")

print(result.title)
print(result.markdown)
```

## OpenAI Function Calling

```python
import openai
import json
from nexract import Nexract

client = Nexract(api_key="SK-LAB-YOUR-KEY")
openai_client = openai.OpenAI()

messages = [{"role": "user", "content": "Summarize https://news.ycombinator.com"}]

response = openai_client.chat.completions.create(
    model="gpt-4o",
    messages=messages,
    tools=[Nexract.openai_tool()],
)

# Handle tool call
tool_call = response.choices[0].message.tool_calls[0]
args      = json.loads(tool_call.function.arguments)
content   = client.handle_tool_call(args["url"])

print(content)
```

## Batch Extraction

```python
urls = [
    "https://example.com/page1",
    "https://example.com/page2",
    "https://example.com/page3",
]

results = client.extract_batch(urls)

for result in results:
    print(f"{result.title} — {result.word_count} words")
```

## Check Balance

```python
info = client.balance()
print(f"Credits remaining: {info['balance']}")
```

## Get Your API Key

→ [nexract.ai/pricing.html](https://www.nexract.ai/pricing.html)

## Links

- [Documentation](https://www.nexract.ai/integrations.html)
- [Website](https://www.nexract.ai)
- [Support](mailto:support@nexract.ai)
