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

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

| Tool | Class | Gives | Call |
| --- | --- | --- | --- |
| `datacircle_list_apis` | `DatacircleListApisTool` | Every GTM API on Datacircle, with the API's slug, number of plans, number of providers and best plan | `GET /apis` |
| `datacircle_best_plans` | `DatacircleBestPlansTool` | 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` | `DatacircleSearchPlansTool` | 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` | `DatacircleProviderTool` | The APIs a provider sells, and the provider's rank on each API | `GET /providers/{slug}` |

## Install

```bash
pip install crewai-datacircle
```

The package needs CrewAI 1.0 or later and Python 3.10 or later.

## Give the tools to an agent

```python
from crewai import Agent, Crew, Task
from crewai_datacircle import datacircle_tools

analyst = Agent(
    role="GTM API analyst",
    goal="Pick the best API for a job",
    backstory="You choose APIs from Datacircle's benchmark.",
    tools=datacircle_tools(),
)
task = Task(
    description="Which email finder API is best for under $5 per 1,000?",
    expected_output="The provider, the plan and its price per 1,000",
    agent=analyst,
)
print(Crew(agents=[analyst], tasks=[task]).kickoff())
```

The agent runs on CrewAI's default model. To use a different model, pass `llm=` to `Agent`.

To give an agent one tool, pass a list with that one tool: `tools=[DatacircleBestPlansTool()]`.

## Call a tool yourself

Each tool returns our API's answer as JSON text:

```python
from crewai_datacircle import DatacircleBestPlansTool

print(DatacircleBestPlansTool().run(slug="email-finder", limit=3))
```

## Tool output for the agent

Each tool gives the agent a JSON object. Each plan comes with a rank, provider, plan, score, price per 1,000 (`perThousand`, in dollars) and a page on datacircle.dev. The page on datacircle.dev lists every field.

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

The agent gets the API's error message when the agent passes an unknown slug. For an unknown API slug, the message lists every valid slug. The agent can then call the tool again with a valid slug. On CrewAI versions that have `ToolFailure`, the tool returns a `ToolFailure`. CrewAI then counts the call as failed. CrewAI checks each number before the tool calls the API. On older CrewAI versions, the tool checks each number itself. If a number is out of range, the agent gets an error message. The tool does not call the API.

## 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. The API takes up to 60 calls a minute from one IP address. When the API asks the tool to wait, the tool waits up to a minute. The tool waits once per call at most. 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
- What each key means: https://datacircle.dev/fields

MIT license.
