LlamaIndex Tools Integration: AnyAPI
AnyAPI is one key and one USD wallet in front of hundreds of data and scraping APIs: Reddit, Instagram, TikTok, YouTube, LinkedIn, Google search and maps, Amazon, and clean JSON from pages that block bots. There is no subscription; you are billed per request in USD.
This package exposes AnyAPI to LlamaIndex as a single AnyAPIToolSpec.
Install
pip install llama-index-tools-anyapi
Set ANYAPI_API_KEY, or pass api_key= to the tool spec. Get a key at
getanyapi.com.
Usage
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.anyapi import AnyAPIToolSpec
agent = FunctionAgent(
tools=AnyAPIToolSpec().to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("What is trending on Reddit right now?"))
The tools also work on their own:
spec = AnyAPIToolSpec()
spec.search_apis("trending posts on reddit", limit=3)
spec.get_api("reddit.trending_posts") # read the strict input schema
spec.run_api("reddit.trending_posts", {"limit": 2})
Every tool has an awaitable twin (asearch_apis, aget_api, arun_api, and
so on) backed by AsyncAnyAPI, so await tool.acall(...) talks to AnyAPI
asynchronously rather than running the blocking client on a thread.
A runnable script is in examples/basic_usage.py.
The five tools
AnyAPI publishes hundreds of SKUs. One tool per SKU would exhaust any agent's context, so this spec ships the AnyAPI MCP server's discovery-then-run loop instead.
| Tool | Charges? | What it does |
|---|---|---|
search_apis |
no | ranked search over the catalog, descriptions kept, schemas omitted |
list_apis |
no | browse summaries, optionally filtered by category |
get_api |
no | one API in full: strict input schema, output schema, per-lane USD pricing, 30-day latency |
run_api |
YES | execute one SKU with a normalized input payload |
get_balance |
no | remaining wallet balance in USD |
Search and browse results carry no input schema. Call get_api for an API
before your first run_api on it and build the input from the schema it
returns: every input schema is strict, so an invented field name fails the call.
Prices
Every static price is published in both denominations and neither is derived
from the other. maxUsd is what one request is billed; maxPer1kUsd is the
same price per 1,000 requests. Quote the per-1k figure to a person, and never
multiply a price yourself. A per-call charge comes back as costUsd on the run
result.
There is no quote tool. get_api already publishes pricing.from.maxUsd, the
most a first-choice run is billed, and pricing.failoverMaxUsd, the ceiling for
any run of that API, so an agent can bound its spend before calling.
Departures from the AnyAPI MCP server
The tool descriptions are the MCP server's own wording, because it already encodes what agents get wrong. Four things differ here:
- there is no quote tool, for the reason above;
- search results carry no
heavymarker; - search requires a query;
- the MCP server names its tools
anyapi_search_apis,anyapi_get_apiand so on, and the shared wording is written that way. Here the tool spec is the namespace, so the tools aresearch_apis,list_apis,get_api,run_apiandget_balance, and theanyapi_prefix is stripped from the descriptions when they are bound, so every tool a description names is one you can call.
License
MIT. See the LICENSE file at the root of the repository.
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 llama_index_tools_anyapi-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_tools_anyapi-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56767779c4f3ef443f507a2ee0c59d7b3011a7b0d56b079061c31449324cf8bf
|
|
| MD5 |
2c3f805aa25debb170553f42aecac787
|
|
| BLAKE2b-256 |
2459693876b204e094a42ad32ffa0ec97745edf27f681ef0817089716e41b4f5
|
Provenance
The following attestation bundles were made for llama_index_tools_anyapi-0.1.0.tar.gz:
Publisher:
release-llama-index-tools-anyapi.yml on getanyapi-com/integrations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_tools_anyapi-0.1.0.tar.gz -
Subject digest:
56767779c4f3ef443f507a2ee0c59d7b3011a7b0d56b079061c31449324cf8bf - Sigstore transparency entry: 2715758997
- Sigstore integration time:
-
Permalink:
getanyapi-com/integrations@79a47e832aeef04626211bba43799cff3900c577 -
Branch / Tag:
refs/tags/llama-index-tools-anyapi-v0.1.0 - Owner: https://github.com/getanyapi-com
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-llama-index-tools-anyapi.yml@79a47e832aeef04626211bba43799cff3900c577 -
Trigger Event:
push
-
Statement type:
File details
Details for the file llama_index_tools_anyapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_tools_anyapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67ccbc487f4f67fee345cc96de730e97dad2922c67d2ae814d11745a068553f3
|
|
| MD5 |
0e89ee850953827341f3a22c7929b4de
|
|
| BLAKE2b-256 |
e9fb155933f3a20176a4748419996cc38ea5a7722ce834192e3c337c7b30fa80
|
Provenance
The following attestation bundles were made for llama_index_tools_anyapi-0.1.0-py3-none-any.whl:
Publisher:
release-llama-index-tools-anyapi.yml on getanyapi-com/integrations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_tools_anyapi-0.1.0-py3-none-any.whl -
Subject digest:
67ccbc487f4f67fee345cc96de730e97dad2922c67d2ae814d11745a068553f3 - Sigstore transparency entry: 2715759373
- Sigstore integration time:
-
Permalink:
getanyapi-com/integrations@79a47e832aeef04626211bba43799cff3900c577 -
Branch / Tag:
refs/tags/llama-index-tools-anyapi-v0.1.0 - Owner: https://github.com/getanyapi-com
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-llama-index-tools-anyapi.yml@79a47e832aeef04626211bba43799cff3900c577 -
Trigger Event:
push
-
Statement type: