Brave images API

Image search endpoints

OpenAPI Specification

brave-images-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Brave Ads campaigns images API
  description: 'API for managing and reporting on Brave Ads campaigns. Enables advertisers to retrieve campaign details and performance data for privacy-preserving native browser ads and search ads. Supports customizable reporting dimensions and metrics including impressions, clicks, spend, and conversion tracking. Authentication uses API keys generated from the Brave Ads dashboard.

    '
  version: 3.0.0
  contact:
    name: Brave Ads
    url: https://brave.com/brave-ads/
    email: adsales@brave.com
  termsOfService: https://brave.com/terms-of-use/
servers:
- url: https://ads-serve.brave.com
  description: Brave Ads API
security:
- ApiKeyAuth: []
tags:
- name: images
  description: Image search endpoints
paths:
  /images/search:
    get:
      operationId: imageSearch
      summary: Image Search
      description: Search for images from the Brave independent index.
      tags:
      - images
      parameters:
      - name: q
        in: query
        required: true
        description: Image search query string.
        schema:
          type: string
          example: mountain landscape
      - name: country
        in: query
        required: false
        description: Country code or ALL for worldwide results.
        schema:
          type: string
          example: US
      - name: search_lang
        in: query
        required: false
        description: Preferred content language (ISO 639-1).
        schema:
          type: string
          example: en
      - name: count
        in: query
        required: false
        description: Number of image results to return. Default 50, max 200.
        schema:
          type: integer
          minimum: 1
          maximum: 200
          default: 50
      - name: safesearch
        in: query
        required: false
        description: Content filtering level. Default is strict for images.
        schema:
          type: string
          enum:
          - false
          - strict
          default: strict
      - name: spellcheck
        in: query
        required: false
        description: Enable autocorrection of the search query. Default true.
        schema:
          type: boolean
          default: true
      responses:
        '200':
          description: Successful image search response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageSearchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    QueryInfo:
      type: object
      description: Information about the search query.
      properties:
        original:
          type: string
          description: The original search query as submitted.
        more_results_available:
          type: boolean
          description: Indicates whether additional result pages are available.
    ImageSearchResponse:
      type: object
      description: Response from the image search endpoint.
      properties:
        type:
          type: string
          example: images
        query:
          $ref: '#/components/schemas/QueryInfo'
        results:
          type: array
          items:
            $ref: '#/components/schemas/ImageResult'
    ErrorResponse:
      type: object
      description: API error response.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code.
            message:
              type: string
              description: Human-readable error message.
    ImageResult:
      type: object
      description: A single image search result.
      properties:
        title:
          type: string
          description: Title or caption of the image.
        url:
          type: string
          format: uri
          description: URL of the source page containing the image.
        description:
          type: string
          description: Description of the image content.
        properties:
          type: object
          description: Image file properties.
          properties:
            url:
              type: string
              format: uri
              description: Direct URL to the original image.
            placeholder:
              type: string
              description: URL to a small proxy-served placeholder image.
            width:
              type: integer
              description: Width of the image in pixels.
            height:
              type: integer
              description: Height of the image in pixels.
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Too Many Requests — rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Bad request — missing or invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden — API key does not have access to this endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 'API key generated from the Brave Ads dashboard at https://ads.brave.com.

        '
externalDocs:
  description: Brave Ads API Documentation
  url: https://ads-help.brave.com/campaign-performance/API/