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

# Content

> Retrieve web content or queue a request for later retrieval; connect to `wss://api.agentfirst.dev/browser` for CDP interaction.



## OpenAPI

````yaml get /browser
openapi: 3.1.0
info:
  title: Agent First
  description: The missing services for agent-first development.
  version: 1.0.0
servers:
  - url: https://api.agentfirst.dev
security:
  - bearerAuth: []
paths:
  /browser:
    get:
      summary: Content
      description: >-
        Retrieve web content or queue a request for later retrieval; connect to
        `wss://api.agentfirst.dev/browser` for CDP interaction.
      parameters:
        - name: id
          description: >-
            The identifier returned by this endpoint of the queued request to
            retrieve; if given, all other params are ignored; either an ID or
            URL is required.
          schema:
            type: string
            format: uuid
            example: 21cb972e-0e0f-47bb-9ce9-65b99e9cee77
          in: query
        - name: url
          description: >-
            The URL of the page to browse; any unsafe characters require [URL
            encoding](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding);
            either a URL or ID is required.
          schema:
            type: string
            format: uri
            maxLength: 2047
            example: https://example.com/
          in: query
        - name: difficulty
          description: The difficulty pool to attempt to access the URL from.
          schema:
            type: string
            enum:
              - low
              - medium
              - high
            default: low
            example: low
          in: query
        - name: speed
          description: >-
            The speed to attempt to access the URL at, where `ridiculous` is 30
            percent faster on average than `light` speed.
          schema:
            type: string
            enum:
              - light
              - ridiculous
              - ludicrous (planned)
            default: light
            example: light
          in: query
        - name: device
          description: >-
            The name as returned by the [devices resource](browser/devices) of
            the device to emulate browsing on (these names are case insensitive
            but must include form- or URL-encoded spaces and punctuation marks);
            device emulation is unused by default.
          schema:
            type: string
            example: null
          in: query
        - name: country
          description: >-
            The [two-letter ISO code](https://www.iso.org/obp/ui/#search/code)
            of the country to browse from (these codes are case insensitive); a
            random country is used by default.
          schema:
            type: string
            example: null
          in: query
        - name: subdivision
          description: >-
            The alphanumeric second part (proceeding the separator) of a
            [first-level subdivision
            code](https://www.iso.org/obp/ui/#search/code) in the (prerequisite)
            country to browse from (these codes are case insensitive); a random
            subdivision is used by default.
          schema:
            type: string
            example: null
          in: query
        - name: city
          description: >-
            The [commonly spelled name](https://www.geonames.org/) of the city
            in the (prerequisite) country to browse from (these names are
            temporarily case sensitive and required to include form- or
            URL-encoded spaces and punctuation marks); a random city is used by
            default.
          schema:
            type: string
            example: null
          in: query
        - name: captcha
          description: >-
            The intended resolution of any detected captcha, where `rejected`
            results in a `403` response.
          schema:
            type: string
            enum:
              - solved
              - ignored
              - rejected
            default: solved
            example: rejected
          in: query
        - name: readiness
          description: >-
            The standard ready event to await before snapshotting browsed
            content.
          schema:
            type: string
            enum:
              - load
              - domcontentloaded
            default: load
            example: load
          in: query
        - name: delay
          description: >-
            The number of supplemental seconds to delay before snapshotting
            browsed content; no delay is used by default.
          schema:
            type: number
            minimum: 0.1
            maximum: 10
            example: null
          in: query
        - name: format
          description: The format to output to.
          schema:
            type: string
            enum:
              - rendered
              - raw
              - markdown
            default: rendered
            example: markdown
          in: query
        - name: expiration
          description: >-
            The age in days of when to consider cached content expired, where
            `0` disables caching.
          schema:
            type: integer
            minimum: 0
            maximum: 1
            default: 1
            example: 0
          in: query
        - name: mode
          description: >-
            The synchronous or asynchronous mode of content retrieval (retrieve
            async content by providing the returned ID).
          schema:
            $ref: '#/components/schemas/Mode'
          in: query
        - name: callback
          description: >-
            The encoded HTTP or HTTPS callback URL or Amazon SQS queue URL or
            ARN to notify when the (prerequisite) async content has been
            retrieved; any SQS queue must grant `sqs:SendMessage` permission to
            the `arn:aws:iam::180363035301:role/api-instance` AWS principal.
          schema:
            type: string
            maxLength: 2047
            example: https%3A%2F%2Fwebhook.site%2F02e249f8-1faf-4fab-bcf5-78ce683e85a8
          in: query
      responses:
        '200':
          description: The page content.
          content:
            text/html:
              schema:
                type: string
        '202':
          description: A job identifier or the request status.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      id:
                        description: The identifier to retrieve the queued request with.
                        type: string
                        format: uuid
                        example: 21cb972e-0e0f-47bb-9ce9-65b99e9cee77
                    required:
                      - id
                  - type: object
                    properties:
                      status:
                        description: The status of the queued request.
                        allOf:
                          - $ref: '#/components/schemas/Status'
                    required:
                      - status
        '401':
          $ref: '#/components/responses/authenticationError'
        '402':
          $ref: '#/components/responses/creditsError'
        '403':
          $ref: '#/components/responses/captchaError'
        '404':
          $ref: '#/components/responses/unsupportedError'
        '422':
          $ref: '#/components/responses/paramsError'
        '429':
          $ref: '#/components/responses/throttlingError'
        '500':
          $ref: '#/components/responses/unknownError'
        '503':
          $ref: '#/components/responses/unavailableError'
        '504':
          $ref: '#/components/responses/timeoutError'
components:
  schemas:
    Mode:
      summary: Retrieval mode
      type: string
      enum:
        - sync
        - async
      default: sync
      example: sync
    Status:
      summary: Job status
      type: string
      enum:
        - retrieving
        - archiving
        - successful
        - failed
      example: retrieving
  responses:
    authenticationError:
      description: The authorization header was missing.
      content:
        text/plain:
          schema:
            type: string
            example: Authorization header must be provided
    creditsError:
      description: No more credits are available.
      content:
        text/plain:
          schema:
            type: string
            example: Credit balance is 0; top up at https://agentfirst.dev/#pricing
    captchaError:
      description: The content was captcha’d.
      content:
        text/plain:
          schema:
            type: string
            example: Captcha was detected
    unsupportedError:
      description: One or more resources is nonexistant.
      content:
        text/plain:
          schema:
            type: string
            example: Domain is nonexistant
    paramsError:
      description: One or more parameters were invalid.
      content:
        text/plain:
          schema:
            type: string
            example: Character counts must be no more than 255
    throttlingError:
      description: The rate limit was exceeded.
      content:
        text/plain:
          schema:
            type: string
            example: Rate limit was exceeded; please retry in 180 seconds
    unknownError:
      description: An unknown error occurred.
      content:
        text/plain:
          schema:
            type: string
            example: Unknown error occurred
    unavailableError:
      description: The service is unavailable.
      content:
        text/plain:
          schema:
            type: string
            example: Service is autoscaling; please retry in 60 seconds
    timeoutError:
      description: The operation timed out.
      content:
        text/plain:
          schema:
            type: string
            example: Request(s) timed out
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````