Web extraction API for AI agents and LLMs
Project description
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.
pip install nexract
Quick Start
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
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
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
info = client.balance()
print(f"Credits remaining: {info['balance']}")
Get Your API Key
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nexract-1.0.0.tar.gz
(5.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nexract-1.0.0.tar.gz.
File metadata
- Download URL: nexract-1.0.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cce0808bd792fa1cb74c3bfe84021e990e108987226d8924acb92997a6653fc
|
|
| MD5 |
3a8910b70672378b3ef08490f399adbb
|
|
| BLAKE2b-256 |
e56c7210d2050f71480b3ab7aa198878e6b5e459ffab5785ba167829d4c11941
|
File details
Details for the file nexract-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nexract-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec6e1c3f26692244ef8d47e139ab90c3b1ba7ad18441e6feb94693046250bcd6
|
|
| MD5 |
a7c4d9ee54b8737296176eb6b9e3d073
|
|
| BLAKE2b-256 |
e1af88591ffedb2124b77d3b78ec30834a83ef37cec588d9d6f80d77f5ea6dc6
|