Agentic Scraper Provider SDK for Python
Server-side SDK for event-driven MCP Market monetization. Use it inside the MCP or API service you publish as a provider. It is separate from the Agentic Scraper client SDK used by consumers.
pip install agentic-scraper-provider-sdk
How charging works
For a Marketplace entry configured with provider_event pricing, the Agentic
Scraper proxy forwards a signed x-agentic-charge-token header to your
service. Report a configured event and count with charge(). Always use the
returned chargedCount; it may be lower than requested when the buyer's
remaining run budget is limited.
FastAPI / async example
import os
from fastapi import FastAPI, Request
from agentic_scraper_provider import AsyncAgenticProviderClient
provider = AsyncAgenticProviderClient(api_key=os.environ["AGENTIC_PROVIDER_API_KEY"])
app = FastAPI()
@app.post("/mcp")
async def mcp(request: Request):
records = await load_records()
result = await provider.charge(
charge_token=request.headers["x-agentic-charge-token"],
event_name="record-returned",
count=len(records),
idempotency_key=f"record-export:{request.headers.get('x-request-id')}",
metadata={"requestedCount": len(records)},
)
return records[:result["chargedCount"]]
Flask / sync example
import os
from flask import Flask, request
from agentic_scraper_provider import AgenticProviderClient
provider = AgenticProviderClient(
api_key=os.environ["AGENTIC_PROVIDER_API_KEY"],
)
app = Flask(__name__)
@app.post("/summarize")
def summarize():
summary = create_summary(request.json["text"])
result = provider.charge(
charge_token=request.headers["x-agentic-charge-token"],
event_name="summary-created",
idempotency_key=f"summary:{request.headers.get('x-request-id')}",
)
return {"summary": summary} if result["chargedCount"] == 1 else {"summary": None}
Reliability rules
- Use a stable
idempotency_keyfor every logical event. - Return or process at most
result["chargedCount"]units. - Both clients retry transport failures, HTTP
429, and5xxresponses while preserving the same idempotency key. - Validation and other
4xxerrors are not retried. - Verification and production use the same
charge()method. Verification returnsverification: trueand creates no billing activity. - Keep the provider API key and charge token on the server. Never expose or log them.
AgenticProviderClient is synchronous for Flask and other WSGI applications.
AsyncAgenticProviderClient is intended for FastAPI and other ASGI services.
The default API base URL is https://mcp.agenticscraper.com.
Full REST and SDK documentation is available at https://docs.agenticscraper.com.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 agentic_scraper_provider_sdk-0.1.0.tar.gz.
File metadata
- Download URL: agentic_scraper_provider_sdk-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9f3c5a1230437edac4656e795d5bc321aebf685f1b8f597fe3aa183625cc1d2
|
|
| MD5 |
3dc8abd064a659ec983d1d8a58449ab5
|
|
| BLAKE2b-256 |
ed2598dffa90a301d935e9a689cbaceabaa45213fb19268252d8ea3669f85934
|
Provenance
The following attestation bundles were made for agentic_scraper_provider_sdk-0.1.0.tar.gz:
Publisher:
provider-sdk-python-release.yml on berkbirkan/agentic-scraper-cloud
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_scraper_provider_sdk-0.1.0.tar.gz -
Subject digest:
b9f3c5a1230437edac4656e795d5bc321aebf685f1b8f597fe3aa183625cc1d2 - Sigstore transparency entry: 2256677409
- Sigstore integration time:
-
Permalink:
berkbirkan/agentic-scraper-cloud@f5b50f558f9e76b9beeb2be1412da42deb3d4137 -
Branch / Tag:
refs/tags/provider-sdk-python-v0.1.0 - Owner: https://github.com/berkbirkan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
provider-sdk-python-release.yml@f5b50f558f9e76b9beeb2be1412da42deb3d4137 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentic_scraper_provider_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentic_scraper_provider_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fda907ef72808416f97c7b02492a0b045cc72b912b6546cc2d2180fc0826948
|
|
| MD5 |
3696b8a607ea841979e7ee40885abd2e
|
|
| BLAKE2b-256 |
423c1a7e3c2a74ae7015ec9bfd97acf3307d819d41849ff1114643416bc87e44
|
Provenance
The following attestation bundles were made for agentic_scraper_provider_sdk-0.1.0-py3-none-any.whl:
Publisher:
provider-sdk-python-release.yml on berkbirkan/agentic-scraper-cloud
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_scraper_provider_sdk-0.1.0-py3-none-any.whl -
Subject digest:
9fda907ef72808416f97c7b02492a0b045cc72b912b6546cc2d2180fc0826948 - Sigstore transparency entry: 2256677412
- Sigstore integration time:
-
Permalink:
berkbirkan/agentic-scraper-cloud@f5b50f558f9e76b9beeb2be1412da42deb3d4137 -
Branch / Tag:
refs/tags/provider-sdk-python-v0.1.0 - Owner: https://github.com/berkbirkan
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
provider-sdk-python-release.yml@f5b50f558f9e76b9beeb2be1412da42deb3d4137 -
Trigger Event:
push
-
Statement type: