Metadata-Version: 2.5
Name: llama-index-tools-datacircle
Version: 0.1.0
Summary: LlamaIndex 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/llama-index-tools-datacircle
Author-email: Wayne Hamadi <wayne@datacircle.dev>
License-Expression: MIT
License-File: LICENSE
Keywords: api,api-pricing,b2b-data,datacircle,gtm,llama-index,llama-index-tools
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <4.0,>=3.10
Requires-Dist: llama-index-core<0.15,>=0.13.0
Description-Content-Type: text/markdown

# llama-index-tools-datacircle

Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website: https://datacircle.dev

This package gives LlamaIndex a tool spec, `DatacircleToolSpec`, with four tools on Datacircle's open API, https://api.datacircle.dev/v1. You need no key and no account.

```bash
pip install llama-index-tools-datacircle
```

| Tool | What it gives | Call |
| --- | --- | --- |
| `list_apis` | Every GTM API on Datacircle, with its slug, number of plans and providers, and its best plan | `GET /apis` |
| `best_plans` | One API's plans, best first by score out of 100, each with its rank and price per 1,000 calls | `GET /apis/{slug}/best` |
| `search_plans` | Plans by provider or plan name, on every API or one, sorted by score, provider or price | `GET /plans` |
| `provider` | The APIs a provider sells and its rank on each | `GET /providers/{slug}` |

## Use

```python
from llama_index.tools.datacircle import DatacircleToolSpec

datacircle = DatacircleToolSpec()
datacircle.best_plans("email-finder", limit=3)

tools = datacircle.to_tool_list()  # the four, for an agent
```

With an agent (any LLM of LlamaIndex that calls tools, here one on Ollama):

```python
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.ollama import Ollama

agent = FunctionAgent(tools=DatacircleToolSpec().to_tool_list(), llm=Ollama(model="gpt-oss:20b", request_timeout=120))
print(await agent.run("Which email finder API is best for under $5 per 1,000?"))
```

`ReActAgent` takes the same tools.

Each tool gives a dict; an agent reads it as JSON. An unknown slug or a value out of range raises `DatacircleError` with the API's words (an unknown API's answer lists every slug), which an agent gives the model as the tool's answer.

## Network

Each call makes one HTTPS GET to https://api.datacircle.dev/v1 with the tool's arguments and nothing else. The API takes up to 60 calls a minute from one address; the tools wait once, a minute at most, when it asks them to. Every plan is also one file at https://datacircle.dev/datacircle.json.

## Links

- Datacircle: https://datacircle.dev
- The API: https://datacircle.dev/api
- Its spec: https://api.datacircle.dev/v1/openapi.json
- What each key means: https://datacircle.dev/fields

MIT license.
