> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enricho.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Search profiles

> Public Instagram, TikTok, X and LinkedIn profiles, priced per profile. No free preview.

`platform` is required; send either `query` (keyword search on Instagram, TikTok and X) or `usernames` (handles or profile URLs on Instagram, X and LinkedIn). Each new profile costs X 3, Instagram 10, TikTok 12 or LinkedIn 20 credits; profiles you already bought are free and counted in `already_purchased`.

```bash theme={null}
curl -X POST 'https://api.enricho.co/api/directory/profiles/search' \
  -H 'Authorization: Bearer enr_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"platform":"instagram","query":"vegan recipes","limit":5}'
```

When `has_more` is true, send the same body with `cursor` set to `next_cursor`. A search's results are kept for about a day, so pages and repeats are consistent.


## OpenAPI

````yaml api-reference/openapi.json POST /api/directory/profiles/search
openapi: 3.1.0
info:
  title: Enricho Public REST API
  version: 1.0.0
  description: >-
    Public directory search and billing APIs. Full search costs 1 credit per
    returned record; previews and usage calls use no credits. Request and
    response contracts reflect the current public gateway and service handlers.
servers:
  - url: https://api.enricho.co
security:
  - apiKey: []
  - headerKey: []
tags:
  - name: Directory
  - name: Billing
paths:
  /api/directory/profiles/search:
    post:
      tags:
        - Directory
      summary: Search profiles
      description: >-
        Public Instagram, TikTok, X and LinkedIn profiles. platform is required,
        plus query (keyword search: Instagram, TikTok, X) or usernames (handles
        or profile URLs: Instagram, X, LinkedIn). There is no free preview: each
        new profile costs X 3, Instagram 10, TikTok 12 or LinkedIn 20 credits;
        profiles the caller already bought are free. A search's results are kept
        for about a day. A page is released only after an atomic full-page debit
        is confirmed.
      operationId: searchProfiles
      requestBody:
        required: true
        description: 'Send JSON with Content-Type: application/json.'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchProfilesRequest'
            examples:
              search:
                summary: Instagram keyword search
                value:
                  platform: instagram
                  query: vegan recipes
                  limit: 5
              lookup:
                summary: X lookup
                value:
                  platform: x
                  usernames:
                    - nasa
                    - nytimes
      responses:
        '200':
          description: Success envelope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  result:
                    $ref: '#/components/schemas/ProfilesPage'
                  message:
                    type: string
                required:
                  - success
                  - result
                  - message
        '400':
          description: >-
            bad_request: malformed JSON, invalid full-search limit, or cursor
            invalid / from different filters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 'unauthorized: missing, invalid or revoked API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            insufficient_credits: insufficient balance for the entire page. No
            records returned and no credits deducted; reduce limit or buy
            credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            validation_failed: unknown platform, both or neither of query and
            usernames, TikTok without query, LinkedIn with query, or invalid
            lengths.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            rate_limited: key, account or IP request limit exceeded; wait a
            minute before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 'internal: unexpected server failure.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: 'upstream_unavailable: gateway could not reach the service.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            upstream_unavailable: profile search, or billing, unavailable. No
            profiles are returned; an unconfirmed charge may already have
            debited credits, so inspect usage before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SearchProfilesRequest:
      type: object
      additionalProperties: false
      required:
        - platform
      properties:
        platform:
          type: string
          enum:
            - instagram
            - tiktok
            - x
            - linkedin
          description: Which network to search.
        query:
          type: string
          maxLength: 200
          description: >-
            Keyword search (Instagram, TikTok, X). Send query or usernames, not
            both.
        usernames:
          anyOf:
            - type: string
            - type: array
              items:
                type: string
              maxItems: 100
          description: >-
            Handles or profile URLs to look up (Instagram, X; LinkedIn profile
            URLs), up to 100.
        limit:
          type: integer
          minimum: 0
          maximum: 100
          default: 10
          description: Profiles for a keyword search, 1–100. Omitted or 0 uses 10.
        cursor:
          type: string
          description: Opaque next_cursor from the previous page of the same search.
    ProfilesPage:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Profile'
          maxItems: 100
        next_cursor:
          type: string
          description: Opaque continuation token; empty when no next page is available.
        has_more:
          type: boolean
          description: Whether a continuation page is available.
        credits_used:
          type: integer
          minimum: 0
          maximum: 2000
          description: >-
            Per new profile: X 3, Instagram 10, TikTok 12, LinkedIn 20; profiles
            already bought and empty pages cost 0.
        already_purchased:
          type: integer
          minimum: 0
          maximum: 100
          description: Profiles the caller bought before; returned without charge.
      required:
        - results
        - next_cursor
        - has_more
        - credits_used
      description: No total_estimate or total_capped fields are returned by public search.
    Error:
      type: object
      properties:
        success:
          type: boolean
          const: false
        result:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
          required:
            - code
        message:
          type: string
          description: Human-readable error; do not parse this as a stable identifier.
      required:
        - success
        - result
        - message
    Profile:
      type: object
      description: A public social profile. Empty strings, null and [] mean not listed.
      properties:
        profile_id:
          type: string
          description: Enricho profile ID.
        platform:
          type: string
          enum:
            - instagram
            - tiktok
            - x
            - linkedin
        username:
          type: string
          description: Handle.
        name:
          type: string
          description: Display name.
        profile_url:
          type: string
          description: Link to the profile.
        headline:
          type: string
          description: LinkedIn headline.
        bio:
          type: string
          description: Bio or LinkedIn about.
        followers:
          type:
            - integer
            - 'null'
          description: Followers.
        following:
          type:
            - integer
            - 'null'
          description: Following, or LinkedIn connections.
        posts:
          type:
            - integer
            - 'null'
          description: Posts, videos or tweets.
        likes:
          type:
            - integer
            - 'null'
          description: Total likes (TikTok).
        verified:
          type: boolean
        private:
          type: boolean
        business_account:
          type: boolean
        category:
          type: string
          description: Business or account category.
        location:
          type: string
          description: Location as listed.
        website:
          type: string
          description: First link.
        links:
          type: array
          items:
            type: string
          description: Bio and website links.
        last_post_at:
          type: string
          format: date
        created_at:
          type: string
          format: date
        company:
          type: string
          description: Current company (LinkedIn).
        job_title:
          type: string
          description: Current title (LinkedIn).
        experience:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              company:
                type: string
              location:
                type: string
              start:
                type: string
              end:
                type: string
        education:
          type: array
          items:
            type: string
          description: Schools (LinkedIn).
        skills:
          type: array
          items:
            type: string
          description: Skills (LinkedIn).
        open_to_work:
          type:
            - boolean
            - 'null'
        related_accounts:
          type: array
          items:
            type: string
          description: Related usernames (Instagram).
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Enricho API key (enr_...)
    headerKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        An Enricho API key (enr_...). Use this or Authorization: Bearer, not
        both.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.