Metadata-Version: 2.5
Name: marvin-datacircle
Version: 0.1.0
Summary: Marvin tools for the Datacircle API: find the best GTM APIs
Project-URL: Homepage, https://datacircle.dev
Project-URL: Documentation, https://api.datacircle.dev/v1/openapi.json
Project-URL: Repository, https://github.com/waynehamadi/marvin-datacircle
License-Expression: MIT
License-File: LICENSE
Keywords: agents,api,api-pricing,b2b-data,datacircle,gtm,marvin,pydantic-ai,tool-calling,tools
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# marvin-datacircle

Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website.

Our website: https://datacircle.dev

This package gives [Marvin](https://github.com/PrefectHQ/marvin) four tools that call Datacircle's open API, https://api.datacircle.dev/v1. Each tool is a plain Python function with type hints and a docstring. Marvin reads each tool's name, description and arguments from the type hints and the docstring. You need no key and no account.

| Tool | What the tool gives | Call |
| --- | --- | --- |
| `datacircle_list_apis` | Every GTM API on Datacircle, with the API's slug, number of plans, number of providers and best plan | `GET /apis` |
| `datacircle_best_plans` | One API's plans, sorted by score out of 100, best first. Each plan comes with a rank and a price per 1,000 calls | `GET /apis/{slug}/best` |
| `datacircle_search_plans` | Plans that match a provider or plan name, on all APIs or on one API. You can sort them by score, provider or price | `GET /plans` |
| `datacircle_provider` | The APIs a provider sells, and the provider's rank on each API | `GET /providers/{slug}` |

## Install

```bash
pip install marvin-datacircle marvin
```

marvin-datacircle works with Marvin 3.2.8 and later, on Python 3.11 and later. marvin-datacircle does not import `marvin`.

Marvin uses OpenAI's `gpt-4o` by default. To use another model, set `MARVIN_AGENT_MODEL=anthropic:claude-haiku-5-5`. You can also give one agent a model: `marvin.Agent(model="anthropic:claude-haiku-5-5")`.

## Use the tools in a run

Give the Datacircle tools to `marvin.run`:

```python
import marvin
from marvin_datacircle import datacircle_tools

print(marvin.run("Who are the 3 best providers for the email-finder API?", tools=datacircle_tools()))
```

`marvin.run_async` and `marvin.run_stream` take the same `tools`.

## Use the tools in an agent

Give the Datacircle tools to an `Agent`. The agent can use the tools on every task:

```python
import marvin
from marvin_datacircle import datacircle_tools

agent = marvin.Agent(name="GTM", tools=datacircle_tools(), instructions="Use the Datacircle tools for questions on GTM APIs.")
print(agent.run("Which provider is first for the email-finder API, and on which other APIs does it rank?"))
```

## Use the tools in a task

Give the Datacircle tools to a `Task`. Set `result_type` to choose the type of the task's result:

```python
import marvin
from marvin_datacircle import datacircle_tools

task = marvin.Task("Name the 3 best providers for the email-finder API.", result_type=list[str], tools=datacircle_tools())
print(task.run())
```

## Use the Datacircle tools beside your own tools

Put the Datacircle tools in one list with your own tools: `tools=[*datacircle_tools(), my_tool]`.

To give the model only some of the tools, list their names: `datacircle_tools(["datacircle_best_plans"])`.

## Call a tool yourself

You can call each tool without a model. You get the tool's answer as a dict:

```python
from marvin_datacircle import datacircle_best_plans, run

print(datacircle_best_plans("email-finder", limit=3)["plans"])
print(run("datacircle_provider", {"slug": "Bright Data"}))
```

## What the model reads

Each tool returns a dict. The model reads the dict as JSON. Each plan comes with a rank, provider, plan, score, price per 1,000 (`perThousand`, in dollars) and a page on datacircle.dev. That page lists every field.

You can give a provider's name in place of a slug. The tool turns `Bright Data` into `bright-data`.

The tool returns `{"error": "..."}` with the API's message when the API gives no data, such as for an unknown slug. The error for an unknown API slug lists every valid slug. The tool checks each number from the model first. For a number out of range, the tool returns `{"error": "..."}` and makes no API call. If the network fails, the tool returns `{"error": "..."}` with the network error's message. The tool never raises an error, so your program keeps running. The model can call the tool again.

## Network

Each tool call makes one HTTPS GET request to https://api.datacircle.dev/v1 and nothing else. The request holds only the tool's own arguments: no key and nothing from your chats. The API takes up to 60 calls a minute from one IP address. The API can ask the tool to wait. The tool then waits once, for a minute at most. Each call uses only Python's standard library. Nothing goes to disk.

## Links

- Datacircle: https://datacircle.dev
- The API's spec: https://api.datacircle.dev/v1/openapi.json
