KOLens Discovery API

The Discovery API from KOLens — 5 operation(s) for discovery.

GitHub OpenAPI

Operations 8

POST /api/discovery-plans Create Plan #
GET /api/discovery-plans List Plans #
GET /api/discovery-plans/{plan_id} Get Plan #
PATCH /api/discovery-plans/{plan_id} Update Plan #
DELETE /api/discovery-plans/{plan_id} Delete Plan #
POST /api/discovery-plans/{plan_id}/run-now Run Plan Now #
GET /api/discovery-plans/{plan_id}/results Get Plan Results #
GET /api/discovery-plans/{plan_id}/videos Get Plan Videos #

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/kolens-ai:kolens-ai-discovery-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

kolens-ai-discovery-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: KOLens Discovery API
  description: KOLens — TikTok KOL Intelligence API. Search keywords, extract KOL profiles, collect contact info, export reports.
  version: 1.0.0
tags:
- name: Discovery
paths:
  /api/discovery-plans:
    post:
      tags:
      - Discovery
      summary: Create Plan
      operationId: create_plan_api_discovery_plans_post
      security:
      - HTTPBearer: []
      parameters:
      - name: x-kolens-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Kolens-User-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscoveryPlanCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryPlanOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Discovery
      summary: List Plans
      description: 'List discovery plans owned by the calling user.


        Scoping (mirrors /api/jobs):

        - With X-Kolens-User-Id (the normal web path): restrict to plans

        owned by that user. Both DiscoveryPlan.user_id and

        APIKey.user_id are honoured (older rows where user_id is NULL

        but the api_key resolves to a user still belong to them).

        - Without the header (CLI / Cowork plugin): legacy per-api_key.


        Was previously scoped only by api_key. Every web user shares the

        same KOLENS_API_KEY through the Vercel proxy, so plans LEAKED

        across users on the listing page until this fix.'
      operationId: list_plans_api_discovery_plans_get
      security:
      - HTTPBearer: []
      parameters:
      - name: status
        in: query
        required: false
        schema:
          anyOf:
          - enum:
            - draft
            - active
            - disabled
            type: string
          - type: 'null'
          title: Status
      - name: x-kolens-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Kolens-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DiscoveryPlanOut'
                title: Response List Plans Api Discovery Plans Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/discovery-plans/{plan_id}:
    get:
      tags:
      - Discovery
      summary: Get Plan
      operationId: get_plan_api_discovery_plans__plan_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: plan_id
        in: path
        required: true
        schema:
          type: string
          title: Plan Id
      - name: x-kolens-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Kolens-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryPlanOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Discovery
      summary: Update Plan
      operationId: update_plan_api_discovery_plans__plan_id__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: plan_id
        in: path
        required: true
        schema:
          type: string
          title: Plan Id
      - name: x-kolens-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Kolens-User-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscoveryPlanUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryPlanOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Discovery
      summary: Delete Plan
      operationId: delete_plan_api_discovery_plans__plan_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: plan_id
        in: path
        required: true
        schema:
          type: string
          title: Plan Id
      - name: x-kolens-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Kolens-User-Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/discovery-plans/{plan_id}/run-now:
    post:
      tags:
      - Discovery
      summary: Run Plan Now
      description: 'Spawn a scrape job from this plan right now. Does NOT advance next_run_at.


        Credits are pre-charged inside ``spawn_job_from_plan`` (since the

        discovery-charge fix). On insufficient balance we surface a 402

        with the exact gap so the UI can render a precise message.'
      operationId: run_plan_now_api_discovery_plans__plan_id__run_now_post
      security:
      - HTTPBearer: []
      parameters:
      - name: plan_id
        in: path
        required: true
        schema:
          type: string
          title: Plan Id
      - name: x-kolens-user-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Kolens-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryRunNowResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/discovery-plans/{plan_id}/results:
    get:
      tags:
      - Discovery
      summary: Get Plan Results
      operationId: get_plan_results_api_discovery_plans__plan_id__results_get
      security:
      - HTTPBearer: []
      parameters:
      - name: plan_id
        in: path
        required: true
        schema:
          type: string
          title: Plan Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                title: Response Get Plan Results Api Discovery Plans  Plan Id  Results Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/discovery-plans/{plan_id}/videos:
    get:
      tags:
      - Discovery
      summary: Get Plan Videos
      operationId: get_plan_videos_api_discovery_plans__plan_id__videos_get
      security:
      - HTTPBearer: []
      parameters:
      - name: plan_id
        in: path
        required: true
        schema:
          type: string
          title: Plan Id
      - name: sort
        in: query
        required: false
        schema:
          type: string
          default: views
          title: Sort
      - name: role
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Role
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 200
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                title: Response Get Plan Videos Api Discovery Plans  Plan Id  Videos Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DiscoveryRunNowResponse:
      properties:
        plan_id:
          type: string
          title: Plan Id
        job_id:
          type: string
          title: Job Id
        status:
          type: string
          title: Status
      type: object
      required:
      - plan_id
      - job_id
      - status
      title: DiscoveryRunNowResponse
    QueryPlanEcho:
      properties:
        raw_query:
          type: string
          title: Raw Query
        search_terms:
          items:
            type: string
          type: array
          title: Search Terms
          default: []
        filters:
          type: object
          title: Filters
          default: {}
        market:
          anyOf:
          - type: string
          - type: 'null'
          title: Market
        language:
          anyOf:
          - type: string
          - type: 'null'
          title: Language
        notes:
          type: string
          title: Notes
          default: ''
      type: object
      required:
      - raw_query
      title: QueryPlanEcho
      description: 'Display-only echo of how the NL query planner interpreted a typed

        intent sentence (Phase 1). Returned on the create / search-submit

        response so the UI can show "Interpreted as: [terms] · filters".


        Only present when the planner flag is ON *and* the planner produced a

        real (non-passthrough) interpretation — null otherwise so existing

        clients ignore it. An editable confirm step is Phase 2.'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DiscoveryPlanUpdate:
      properties:
        name:
          anyOf:
          - type: string
            maxLength: 200
            minLength: 1
          - type: 'null'
          title: Name
        keyword:
          anyOf:
          - type: string
            maxLength: 200
            minLength: 1
          - type: 'null'
          title: Keyword
        platform:
          anyOf:
          - type: string
          - type: 'null'
          title: Platform
        interval_hours:
          anyOf:
          - type: integer
            maximum: 720.0
            minimum: 1.0
          - type: 'null'
          title: Interval Hours
        max_videos_per_run:
          anyOf:
          - type: integer
            maximum: 2000.0
            minimum: 1.0
          - type: 'null'
          title: Max Videos Per Run
        region:
          anyOf:
          - type: string
          - type: 'null'
          title: Region
          description: ISO-3166 alpha-2 country code. Send an empty string to clear the plan's region back to the global default.
        filters:
          anyOf:
          - $ref: '#/components/schemas/DiscoveryFilters'
          - type: 'null'
        target_list_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Target List Id
        status:
          anyOf:
          - type: string
            enum:
            - draft
            - active
            - disabled
          - type: 'null'
          title: Status
        data_source:
          anyOf:
          - type: string
          - type: 'null'
          title: Data Source
      type: object
      title: DiscoveryPlanUpdate
    DiscoveryFilters:
      properties:
        min_followers:
          anyOf:
          - type: integer
            minimum: 0.0
          - type: 'null'
          title: Min Followers
        max_followers:
          anyOf:
          - type: integer
            minimum: 0.0
          - type: 'null'
          title: Max Followers
        min_avg_views:
          anyOf:
          - type: integer
            minimum: 0.0
          - type: 'null'
          title: Min Avg Views
        min_engagement_rate:
          anyOf:
          - type: number
            maximum: 100.0
            minimum: 0.0
          - type: 'null'
          title: Min Engagement Rate
        require_email:
          type: boolean
          title: Require Email
          default: false
        roles_in:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Roles In
          description: 'Only auto-add authors whose dominant role is in this list. Allowed values: KOL, Seller, Customer, Passenger.'
      type: object
      title: DiscoveryFilters
      description: Filters applied to scraped KOLs before auto-adding to target_list.
    DiscoveryPlanCreate:
      properties:
        name:
          type: string
          maxLength: 200
          minLength: 1
          title: Name
        keyword:
          type: string
          maxLength: 200
          minLength: 1
          title: Keyword
        platform:
          type: string
          title: Platform
          description: User-facing platform. One of tiktok / instagram / x / douyin. The backend resolves this to an internal data_source for pipeline dispatch.
          default: tiktok
        interval_hours:
          type: integer
          maximum: 720.0
          minimum: 1.0
          title: Interval Hours
          default: 24
        max_videos_per_run:
          type: integer
          maximum: 2000.0
          minimum: 1.0
          title: Max Videos Per Run
          default: 100
        region:
          anyOf:
          - type: string
          - type: 'null'
          title: Region
          description: ISO-3166 alpha-2 country code (e.g. 'US', 'JP', 'SG'). Copied onto every job the scheduler spawns from this plan; the TikTok scrape then browses as if from that country. Omit / empty = the global (US) default.
        filters:
          anyOf:
          - $ref: '#/components/schemas/DiscoveryFilters'
          - type: 'null'
        target_list_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Target List Id
        status:
          type: string
          enum:
          - draft
          - active
          - disabled
          title: Status
          description: draft (saved, NOT scheduled) | active (scheduler picks up) | disabled (paused). Defaults to draft — creating a plan no longer auto-schedules it; the user opts in by hitting Activate on the detail page once they've verified the keyword + filters.
          default: draft
        data_source:
          anyOf:
          - type: string
          - type: 'null'
          title: Data Source
          description: DEPRECATED — pass ``platform`` instead. Accepted only for backward compat with pre-#163 callers.
      type: object
      required:
      - name
      - keyword
      title: DiscoveryPlanCreate
      description: 'Issue #163 — the preferred field is now ``platform`` (one of

        ``tiktok / instagram / x / douyin``). ``data_source`` is retained

        for backward compat with pre-#163 callers (CLI, Cowork plugin) but

        emits a deprecation warning server-side and is resolved to a

        platform via ``discovery_platform_resolver``.'
    DiscoveryPlanOut:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        keyword:
          type: string
          title: Keyword
        platform:
          type: string
          title: Platform
        interval_hours:
          type: integer
          title: Interval Hours
        max_videos_per_run:
          type: integer
          title: Max Videos Per Run
        region:
          anyOf:
          - type: string
          - type: 'null'
          title: Region
        filters:
          anyOf:
          - type: object
          - type: 'null'
          title: Filters
        target_list_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Target List Id
        status:
          type: string
          enum:
          - draft
          - active
          - disabled
          title: Status
        effective_status:
          type: string
          enum:
          - draft
          - active
          - disabled
          - queued
          - running
          - failed
          title: Effective Status
        data_source:
          type: string
          title: Data Source
        last_run_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Run At
        next_run_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Next Run At
        last_job_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Job Id
        last_job_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Job Status
        last_error:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Error
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
        query_plan:
          anyOf:
          - $ref: '#/components/schemas/QueryPlanEcho'
          - type: 'null'
      type: object
      required:
      - id
      - name
      - keyword
      - platform
      - interval_hours
      - max_videos_per_run
      - filters
      - target_list_id
      - status
      - effective_status
      - data_source
      - last_run_at
      - next_run_at
      - last_job_id
      - created_at
      - updated_at
      title: DiscoveryPlanOut
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer