TrendsAGI Context Injection API

The Context Injection API from TrendsAGI — 8 operation(s) for context injection.

GitHub OpenAPI

Operations 9

GET /api/trends/{trend_id}/ai-insights Retrieve pre-processed summaries #
POST /api/trends/{trend_id}/ai-insights/generate Queue a fresh AI-insight brief using the current trend data #
GET /api/trends/ai-insights/status/{task_id} Poll the asynchronous insight-generation task returned by the generation… #
GET /api/insights/search Search cached insight content and trend metadata #
POST /api/trends/{trend_id}/enrich Run an on-demand Deep Dive for a trend and return the requested evidence modules #
GET /api/trends/{trend_id}/creators List the accounts posting most about a trend, with follower counts and post… #
POST /api/trends/{trend_id}/ask Ask a question about one trend #
GET /api/trends/{trend_id}/social-evidence Read the stored Social Evidence report for a trend: the posts, transcripts… #
POST /api/trends/{trend_id}/social-evidence Run or refresh Social Evidence for a trend #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/trendsagi-com:trendsagi-com-context-injection-api"
All apis
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.

Get an API 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 Specification

trendsagi-com-context-injection-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TrendsAGI Context Injection 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: Context Injection
paths:
  /api/trends/{trend_id}/ai-insights:
    get:
      tags:
      - Context Injection
      operationId: getAiInsights
      summary: Retrieve pre-processed summaries
      description: 'Retrieve pre-processed summaries. This GET request serves cached AI insights designed to be injected into your agent''s prompt; it does not trigger a new inference run.


        This method is read-only. Developer includes up to 10 insight generations/day, Advantage 50/day, and Scale 200/day; this GET serves the cached result without starting a generation.'
      x-plan-tier: Developer
      parameters:
      - name: trend_id
        in: path
        required: true
        description: The signal ID.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                trend_id: 123
                sentiment_category: Mixed
                sentiment_summary: Excitement for features vs fear of job loss.
                marketing_angle: Focus on productivity enhancement.
                key_themes:
                - Efficiency
                - Automation
                - Cost
                generated_at: '2025-05-04T12:00:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/trends/{trend_id}/ai-insights/generate:
    post:
      tags:
      - Context Injection
      operationId: generateAiInsights
      summary: Queue a fresh AI-insight brief using the current trend data
      description: 'Queue a fresh AI-insight brief using the current trend data. Successful responses include durable post-reservation usage headers so clients can show the remaining daily allowance.


        Success and 429 responses expose X-Daily-Usage-Name, X-Daily-Usage-Current, and X-Daily-Usage-Limit.


        A 429 response includes code LIMIT_REACHED. A 503 means the durable usage meter is unavailable, so no unmetered generation is queued.


        Developer includes 10 generations/day, Advantage 50/day, and Scale 200/day.'
      x-plan-tier: Developer
      parameters:
      - name: trend_id
        in: path
        required: true
        description: The signal ID.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                task_id: insight_123_1784365200000000000
                status: queued
                message: AI insight generation has been queued
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      requestBody:
        description: Generation options.
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                force_refresh:
                  type: boolean
                  description: Optional. Rebuild cached insight content when true.
  /api/trends/ai-insights/status/{task_id}:
    get:
      tags:
      - Context Injection
      operationId: getAiInsightStatus
      summary: Poll the asynchronous insight-generation task returned by the generation…
      description: 'Poll the asynchronous insight-generation task returned by the generation endpoint.


        Status is PENDING, PROCESSING, SUCCESS, or FAILURE; FAILURE may include an error string.


        Task IDs are owner-bound. Missing, expired, and cross-user IDs return the same 404; status-store outages return 503 and are never assumed successful.'
      x-plan-tier: Developer
      parameters:
      - name: task_id
        in: path
        required: true
        description: The task ID returned by the generation endpoint.
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                status: PENDING
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/insights/search:
    get:
      tags:
      - Context Injection
      operationId: searchInsights
      summary: Search cached insight content and trend metadata
      description: Search cached insight content and trend metadata. Query free text or narrow results by theme, sentiment, and audience keywords.
      x-plan-tier: Advantage
      parameters:
      - name: q
        in: query
        required: false
        description: Optional free-text search across trend names, categories, and cached insight content.
        schema:
          type: string
      - name: keyThemeContains
        in: query
        required: false
        description: Filter by semantic theme.
        schema:
          type: string
      - name: sentimentCategory
        in: query
        required: false
        description: Filter by sentiment (positive/negative).
        schema:
          type: string
      - name: audienceKeyword
        in: query
        required: false
        description: Filter by target audience demographics.
        schema:
          type: string
      - name: limit
        in: query
        required: false
        description: 'Optional result limit from 1 to 100. Default: 20.'
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                results:
                - id: 456
                  title: '[positive] Insight on #GreenTech'
                  type: trend
                  category: Technology
                  sentiment: positive
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/trends/{trend_id}/enrich:
    post:
      tags:
      - Context Injection
      operationId: postTrendEnrich
      summary: Run an on-demand Deep Dive for a trend and return the requested evidence modules
      description: 'Run an on-demand Deep Dive for a trend and return the requested evidence modules. A Deep Dive reserves credits only when it produces usable live data; a cache hit costs nothing and returns the cached envelope.


        A 402 response includes a topup prompt with the available packs; credits are reserved before the provider calls and released when no usable data was produced.


        This endpoint is the on-demand Deep Dive; the GET routes below only read stored results.'
      x-plan-tier: Developer
      parameters:
      - name: trend_id
        in: path
        required: true
        description: The signal ID.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                trend_id: 123
                request_id: 1f47d6d0-3e6b-4f0e-9a2f-2f4c1b7a9d10
                status: complete
                credits_charged: 1
                credits_remaining:
                  included: 9
                  purchased: 0
                  resets_at: '2026-12-01T00:00:00Z'
                search_demand:
                  geo: US
                  label: Example label
                  series: []
                  related: []
                  divergence: aligned
                ads: []
                creators:
                  trend_id: 123
                  label: Example label
                  creators: []
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      requestBody:
        description: Modules to build. Omit them to use the trend's default module set.
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                modules:
                  type: array
                  items:
                    type: string
                  description: 'Optional. Any of: search_demand, ads, creators.'
                region:
                  type: string
                  description: 'Optional. Two-letter market code. Default: US.'
                force:
                  type: boolean
                  description: Optional. Rebuild a cached module instead of serving it.
                request_id:
                  type: string
                  description: Optional. Idempotency key for the credit reservation.
  /api/trends/{trend_id}/creators:
    get:
      tags:
      - Context Injection
      operationId: getTrendCreators
      summary: List the accounts posting most about a trend, with follower counts and post…
      description: 'List the accounts posting most about a trend, with follower counts and post counts. The ranking measures posting activity, not influence.


        Accounts posting most is not a measure of influence.'
      x-plan-tier: Developer
      parameters:
      - name: trend_id
        in: path
        required: true
        description: The signal ID.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                trend_id: 123
                label: Example label
                creators:
                - screen_name: examplecreator
                  followers_count: 120000
                  posts: 4
                  latest_post_snippet: A recent post about the trend.
                  profile_url: https://example.com/creator
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
  /api/trends/{trend_id}/ask:
    post:
      tags:
      - Context Injection
      operationId: postTrendAsk
      summary: Ask a question about one trend
      description: 'Ask a question about one trend. The answer is grounded in the evidence TrendsAGI has captured for that trend (insight, dossier, measured snapshots, social evidence and search demand) and returns numbered citations plus the evidence kinds used.


        When the captured evidence is insufficient, the response says so and grounded is false; it does not invent an answer.


        Citations may only use the evidence the server returned.'
      x-plan-tier: Developer
      parameters:
      - name: trend_id
        in: path
        required: true
        description: The signal ID.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                answer: A grounded answer.
                citations:
                - n: 1
                  title: A source title
                  url: https://example.com/source
                  source_type: dossier
                grounded: true
                evidence:
                - kind: dossier
                  label: Trend dossier
                  count: 1
                follow_ups:
                - A useful follow-up question
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      requestBody:
        description: The question to answer.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                question:
                  type: string
                  description: Required. The question about this trend.
              required:
              - question
  /api/trends/{trend_id}/social-evidence:
    get:
      tags:
      - Context Injection
      operationId: getTrendSocialEvidence
      summary: 'Read the stored Social Evidence report for a trend: the posts, transcripts…'
      description: 'Read the stored Social Evidence report for a trend: the posts, transcripts, creators, comments, ads, sponsors, hashtags and brand mentions that made the trend rise, with a coverage quality summary.


        This GET is free; a report is trend-scoped and is shared by every customer who opens the same trend.


        Returns 404 with {"present": false} when no report exists yet. A section below its minimum sample is returned with present=false and no placeholder rows.'
      x-plan-tier: Developer
      parameters:
      - name: trend_id
        in: path
        required: true
        description: The signal ID.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                trend_id: 123
                status: complete
                refreshed_at: '2026-11-08T09:00:00Z'
                credits_charged: 0
                credits_remaining:
                  included: 9
                  purchased: 0
                  resets_at: '2026-12-01T00:00:00Z'
                sections:
                  posts:
                    present: true
                    sample_size: 24
                    items: []
                quality:
                  completeness: strong
                  as_of: '2026-11-08T09:00:00Z'
                  source_count: 24
                  sections_present: 6
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
    post:
      tags:
      - Context Injection
      operationId: postTrendSocialEvidence
      summary: Run or refresh Social Evidence for a trend
      description: 'Run or refresh Social Evidence for a trend. The response is the served report; the run reserves one Social Evidence credit on a cache hit or miss and can take 30-50 seconds.


        One Social Evidence credit is reserved per run, cache hit or miss.


        A 402 response includes a topup prompt; a cost guard can pause the run without charging.'
      x-plan-tier: Developer
      parameters:
      - name: trend_id
        in: path
        required: true
        description: The signal ID.
        schema:
          type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                trend_id: 123
                status: complete
                refreshed_at: '2026-11-08T09:00:00Z'
                credits_charged: 1
                credits_remaining:
                  included: 9
                  purchased: 0
                  resets_at: '2026-12-01T00:00:00Z'
                sections:
                  posts:
                    present: true
                    sample_size: 24
                    items: []
                quality:
                  completeness: strong
                  as_of: '2026-11-08T09:00:00Z'
                  source_count: 24
                  sections_present: 6
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
      requestBody:
        description: Report modules and options.
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                modules:
                  type: array
                  items:
                    type: string
                  description: 'Optional. Any of: posts, transcripts, creators, comments, ads, sponsors, hashtags, mentions.'
                region:
                  type: string
                  description: 'Optional. Two-letter market code. Default: US.'
                force:
                  type: boolean
                  description: Optional. Rebuild the report instead of serving the stored one.
                request_id:
                  type: string
                  description: Optional. Idempotency key for the credit reservation.
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