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

# Perplexity

> Send a prompt to Perplexity and receive a sourced, web-search-grounded response.

<Note>
  Perplexity endpoints require a paid plan (Starter or higher). Without one, this endpoint returns `402 plan_upgrade_required`. See [Pricing](/pricing) for details.
</Note>


## OpenAPI

````yaml get /v1/perplexity/prompt
openapi: 3.1.0
info:
  title: Scrapio
  version: 1.0.0
  description: >-
    Turn any URL into structured data. Fetch raw HTML, crawl sites, extract
    structured content, interact with dynamic pages, and search the web through
    one API.
  contact:
    name: Scrapio Support
    url: https://scrapio.dev
  license:
    name: Proprietary
servers:
  - url: https://api.scrapio.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: System
  - name: Fetch
  - name: Crawl
  - name: Map
  - name: Interact
  - name: Search
  - name: Google
  - name: Fast Search
  - name: Jobs
  - name: YouTube
  - name: Amazon
  - name: Walmart
  - name: Booking
  - name: Agoda
  - name: Airbnb
  - name: ChatGPT
  - name: Perplexity
  - name: Gemini
  - name: Bing
  - name: Reddit
  - name: TikTok
  - name: Apple App Store
  - name: Target
  - name: Monitors
paths:
  /v1/perplexity/prompt:
    get:
      tags:
        - Perplexity
      summary: Query Perplexity
      description: >-
        Sends a prompt to Perplexity (which always performs a live web search)
        and returns the structured response: answer Markdown, suggested related
        queries, and cited sources. Backed by our own maintained `perplexity`
        Web Scraping API target. Requires a Starter plan or higher.
      operationId: promptPerplexity
      parameters:
        - name: prompt
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 8000
            description: The prompt sent to Perplexity
        - name: geo
          in: query
          required: false
          schema:
            description: Country to use when submitting the prompt
            type: string
            minLength: 2
            maxLength: 64
      responses:
        '200':
          description: Structured Perplexity response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerplexityPromptResponse'
        '400':
          description: Invalid prompt parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Perplexity dedicated endpoints require a Starter plan or higher.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Daily credit cap exceeded, or the upstream provider rate-limited the
            request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Perplexity upstream failed or returned an unusable response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Perplexity execution backend unavailable or unconfigured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: >-
            curl
            "https://api.scrapio.dev/v1/perplexity/prompt?prompt=Top%203%20tips%20to%20improve%20productivity%20while%20working%20from%20home"
            \
              -H "Authorization: Bearer $SCRAPIO_API_KEY"
components:
  schemas:
    PerplexityPromptResponse:
      type: object
      properties:
        provider:
          type: string
          enum:
            - perplexity
        request_id:
          type: string
        prompt:
          type: string
        model:
          anyOf:
            - type: string
            - type: 'null'
        answer_markdown:
          anyOf:
            - type: string
            - type: 'null'
        related_queries:
          type: array
          items:
            type: string
        sources:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
              title:
                anyOf:
                  - type: string
                  - type: 'null'
              source:
                anyOf:
                  - type: string
                  - type: 'null'
            required:
              - url
              - title
              - source
            additionalProperties: false
      required:
        - provider
        - request_id
        - prompt
        - model
        - answer_markdown
        - related_queries
        - sources
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
        diagnostics:
          type: object
          properties:
            outcome:
              type: string
              enum:
                - failed
            retryable:
              type: boolean
            blocked:
              type: boolean
            timed_out:
              type: boolean
          required:
            - outcome
            - retryable
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````