TrendsAGI Agents API
The Agents API from TrendsAGI — 4 operation(s) for agents.
Operations 4
POST
/api/agent/tools/{name}
Run one agent tool by name with its arguments as the JSON body, and get the…
#
The Agents API from TrendsAGI — 4 operation(s) for agents.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/trendsagi-com:trendsagi-com-agents-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: TrendsAGI Agents API
version: 1.0.0
description: 'REST API for measured trending-topic volume, velocity and growth, AI-generated trend insights, recommendations, alerts, exports and integrations. A free Developer plan includes 100 API calls per day; paid plans raise the limits. Documentation: https://trendsagi.com/api-docs'
termsOfService: https://trendsagi.com/terms
contact:
name: TrendsAGI
url: https://trendsagi.com
servers:
- url: https://api.trendsagi.com
security:
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: Agents
paths:
/api/agent/schema:
get:
tags:
- Agents
operationId: getAgentSchema
summary: 'Describe the tables an agent can query with SQL: every column''s type and…'
description: 'Describe the tables an agent can query with SQL: every column''s type and meaning, the query rules, limits and example queries. The hosted MCP server serves the same document as the read_data_schema tool.
Tables: trends, trend_snapshots (90 days of readings), trend_categories, trend_insights, watchlist, recommendations and crisis_events. The last three only ever contain your own account''s rows.'
x-plan-tier: Developer
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
example:
dialect: PostgreSQL
limits:
max_query_chars: 10000
default_max_rows: 100
max_rows: 1000
timeout_seconds: 5
tables:
- name: trends
description: One row per trending topic TrendsAGI has seen on social platforms...
columns:
- name: volume
type: integer
description: Newest measured volume. NULL means not measured, never zero.
- name: recommendations
requires: A plan with recommendations.
columns: []
examples:
- question: Which topics are rising fastest right now?
sql: SELECT id, name, volume, growth_pct FROM trends WHERE ...
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/RateLimited'
/api/agent/sql:
post:
tags:
- Agents
operationId: executeAgentSql
summary: Run one read-only PostgreSQL SELECT over your TrendsAGI data, for questions…
description: 'Run one read-only PostgreSQL SELECT over your TrendsAGI data, for questions that need filtering, joins or aggregation. The hosted MCP server exposes this as the execute_sql tool.
Queries are validated before they run: one SELECT, only the documented tables, and common aggregate, window, date/time, string, math, array and jsonb functions. Anything else returns 400 with an error code such as unknown_table or function_not_allowed and a message naming the problem.
Each query runs read-only and is cancelled after 5 seconds (error code timeout). A table outside your plan returns 403 plan_required.
Each query counts as one API request against your daily limit.'
x-plan-tier: Developer
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
example:
columns:
- name: category
type: text
- name: trends
type: int8
- name: avg_growth_pct
type: numeric
rows:
- - Sports
- 41
- 38.2
- - Technology
- 57
- 21.7
row_count: 2
truncated: false
tables:
- trends
elapsed_ms: 412
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/RateLimited'
requestBody:
description: The query.
required: true
content:
application/json:
schema:
type: object
properties:
query:
type: string
description: Required. One SELECT (WITH ... SELECT is fine) over the tables from /api/agent/schema. At most 10,000 characters.
max_rows:
type: integer
description: 'Optional. Rows to return, 1 to 1000. Default: 100.'
max_result_bytes:
type: integer
description: 'Optional. Stop adding rows once the encoded rows reach this size. Default and maximum: 1 MB.'
required:
- query
/api/agent/tools:
get:
tags:
- Agents
operationId: listAgentTools
summary: 'List the TrendsAGI agent tools in WebMCP''s shape: name, title, description…'
description: 'List the TrendsAGI agent tools in WebMCP''s shape: name, title, description, JSON input schema and annotations (readOnlyHint, untrustedContentHint). The hosted MCP server, the TrendsAGI app''s WebMCP tools and this endpoint all serve the same read-only tools.
No sign-in needed: the tool list is the same for every account. Responses are cacheable for 5 minutes.
Pass each entry (plus an execute callback) to document.modelContext.registerTool to offer the tool to a browser agent through WebMCP.'
x-plan-tier: Developer
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
example:
instructions: These tools read the signed-in user's TrendsAGI account...
tools:
- name: list_trends
title: List trending topics
description: List topics trending now on social platforms with measured volume, velocity and growth...
inputSchema:
type: object
properties:
category:
type: string
sort_by:
type: string
enum:
- velocity
- growth
- volume
- timestamp
- name
default: velocity
limit:
type: integer
minimum: 1
maximum: 25
default: 10
required: []
additionalProperties: false
annotations:
readOnlyHint: true
untrustedContentHint: true
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/RateLimited'
security: []
/api/agent/tools/{name}:
post:
tags:
- Agents
operationId: callAgentTool
summary: Run one agent tool by name with its arguments as the JSON body, and get the…
description: 'Run one agent tool by name with its arguments as the JSON body, and get the same result the hosted MCP server''s tools/call returns. The TrendsAGI app''s WebMCP tools call this with the signed-in session; an API key works too.
A tool that fails still answers 200 with isError true and a JSON text explaining why (invalid_arguments, http_403 with an upgrade hint, http_429 with a wait hint), so an agent can recover.
An unknown tool name returns 404 with the list of tools. Arguments that are not a JSON object return 400.
With an API key, each call counts as the API request it runs, as on the MCP server. With a browser session (WebMCP), it counts as app use, like the same view in the app.'
x-plan-tier: Developer
parameters:
- name: name
in: path
required: true
description: A tool name from GET /api/agent/tools, e.g. list_trends.
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
example:
content:
- type: text
text: '{"trends":[{"id":123,"name":"#AIUpdate","volume":55200}]}'
isError: false
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/RateLimited'
requestBody:
description: The tool's arguments, matching its inputSchema. Send {} for a tool without arguments.
required: false
content:
application/json:
schema:
type: object
properties:
(tool arguments):
type: object
description: 'For example {"category": "Technology", "limit": 5} for list_trends.'
components:
responses:
Unauthorized:
description: Missing or invalid API key
content:
application/json:
schema:
type: object
properties:
detail:
type: string
RateLimited:
description: Daily or per-second plan limit reached
content:
application/json:
schema:
type: object
properties:
detail:
type: string
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: API key from your TrendsAGI account settings.
BearerAuth:
type: http
scheme: bearer
description: 'The same API key sent as `Authorization: Bearer <key>`.'
externalDocs:
description: TrendsAGI API documentation
url: https://trendsagi.com/api-docs