Metadata-Version: 2.5
Name: swarms-datacircle
Version: 0.1.0
Summary: swarms 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/swarms-datacircle
License-Expression: MIT
License-File: LICENSE
Keywords: agents,api,api-pricing,b2b-data,datacircle,function-calling,gtm,multi-agent,swarms,tools
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: pydantic>=2
Description-Content-Type: text/markdown

# swarms-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 [swarms](https://github.com/kyegomez/swarms) agents four tools that call Datacircle's public API, https://api.datacircle.dev/v1. You need no key and no account.

| 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 swarms swarms-datacircle
```

The tools work with swarms 8.0 or later and Python 3.10 or later.

## Give the tools to an agent

Each tool is a plain Python function with type hints and a docstring, the way swarms takes tools. Pass the list `TOOLS` to an agent:

```python
from swarms import Agent
from swarms_datacircle import TOOLS

agent = Agent(
    agent_name="api-picker",
    model_name="gpt-4o-mini",
    tools=TOOLS,
    max_loops=2,
)

print(agent.run("Which email finder API is best for under $5 per 1,000?"))
```

The model picks a tool. The agent runs the tool and gives the model the result. Give the agent 2 loops or more, or `max_loops="auto"`, so the model can answer after the tool call.

To add the Datacircle tools to your own tools, list them together: `tools=[my_tool, *TOOLS]`.

To give an agent only a few Datacircle tools, import only those:

```python
from swarms import Agent
from swarms_datacircle import datacircle_best_plans, datacircle_search_plans

agent = Agent(model_name="gpt-4o-mini", tools=[datacircle_best_plans, datacircle_search_plans], max_loops=2)
```

The tools also work with `agent.arun()`, with `streaming_on=True` and with `dynamic_tools=True`.

## Call a tool yourself

Each tool returns JSON text:

```python
import json
from swarms_datacircle import datacircle_best_plans

result = json.loads(datacircle_best_plans("email-finder", limit=3))
print(result["plans"][0])
```

## Tool output for the model

Each result is our API's answer 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`.

For an unknown slug, the model gets `{"error": ...}` with a list of every valid slug. The model can then pick a valid slug and call the tool again. The tool checks each value from the model before the API call. For a number out of range, the tool makes no API call. The model gets `{"error": ...}` instead. A tool never raises, so a bad call never stops the agent.

## Network

Each tool call makes one HTTPS GET request to https://api.datacircle.dev/v1 and no other network calls. The request holds only the tool's input. The API takes up to 60 calls a minute from one IP address. If the API says to wait, the tool waits up to a minute. The tool waits at most once per call. All plans are in one file at https://datacircle.dev/datacircle.json.

## Links

- Datacircle: https://datacircle.dev
- The API: https://datacircle.dev/api
- The API's spec: https://api.datacircle.dev/v1/openapi.json
- The meaning of each key: https://datacircle.dev/fields

MIT license.
