{
  "openapi": "3.0.1",
  "info": {
    "title": "Brave Search API — Web, News & Image Results",
    "description": "Run Brave Search queries and export structured web, news, image, video, and infobox results with ranking, snippets, URLs, and source metadata.",
    "version": "1.0",
    "x-build-id": "E8Tg5QE0NpI09deRH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/junipr~brave-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-junipr-brave-search",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/junipr~brave-search/runs": {
      "post": {
        "operationId": "runs-sync-junipr-brave-search",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/junipr~brave-search/run-sync": {
      "post": {
        "operationId": "run-sync-junipr-brave-search",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "apiKey": {
            "title": "Brave API Key",
            "type": "string",
            "description": "Your Brave Search API key. Get a free key (2,000 queries/month) at https://brave.com/search/api/. Leave empty to use zero-config HTML scrape mode."
          },
          "queries": {
            "title": "Search Queries",
            "type": "array",
            "description": "One or more search queries to run. Each query is a separate search. Maximum 500 queries per run.",
            "items": {
              "type": "string"
            },
            "default": [
              "web scraping tools"
            ]
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "web",
              "images",
              "news",
              "videos"
            ],
            "type": "string",
            "description": "Type of search to perform. Web returns general results; images, news, and videos return specialized results.",
            "default": "web"
          },
          "count": {
            "title": "Results Per Query",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Number of results to return per query. Minimum 1, maximum 20 (Brave API limit per request).",
            "default": 10
          },
          "offset": {
            "title": "Pagination Offset",
            "minimum": 0,
            "maximum": 9,
            "type": "integer",
            "description": "Starting offset for results (0-based). Use with paginate=false to skip to a specific page.",
            "default": 0
          },
          "paginate": {
            "title": "Auto-Paginate",
            "type": "boolean",
            "description": "Automatically paginate through results to collect up to maxResults per query. Each additional page counts as one API call.",
            "default": false
          },
          "maxResults": {
            "title": "Max Results (when paginating)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum results to collect per query when paginate is enabled. Minimum 1, maximum 200.",
            "default": 50
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Country code for localized results (ISO 3166-1 alpha-2). Examples: us, gb, de, fr, jp.",
            "default": "us"
          },
          "searchLang": {
            "title": "Search Language",
            "type": "string",
            "description": "Language for search results (ISO 639-1). Examples: en, de, fr, es, ja.",
            "default": "en"
          },
          "uiLang": {
            "title": "UI Language",
            "type": "string",
            "description": "UI language for Brave API metadata (IETF BCP 47). Examples: en-US, de-DE, fr-FR.",
            "default": "en-US"
          },
          "safesearch": {
            "title": "Safe Search",
            "enum": [
              "off",
              "moderate",
              "strict"
            ],
            "type": "string",
            "description": "Safe search filter level: off (no filter), moderate (default), or strict (family-safe only).",
            "default": "moderate"
          },
          "freshness": {
            "title": "Freshness Filter",
            "type": "string",
            "description": "Filter by content age. Use pd (past day), pw (past week), pm (past month), py (past year), or a date range like 2024-01-01to2024-12-31. Leave empty for no filter."
          },
          "textDecorations": {
            "title": "Text Decorations",
            "type": "boolean",
            "description": "Include bold markers in snippets to highlight matching terms.",
            "default": false
          },
          "spellcheck": {
            "title": "Spellcheck",
            "type": "boolean",
            "description": "Allow Brave to spellcheck and correct the query automatically.",
            "default": true
          },
          "goggles": {
            "title": "Goggles URL",
            "type": "string",
            "description": "Optional Goggles URL for custom search re-ranking. See https://search.brave.com/help/goggles for available goggles."
          },
          "units": {
            "title": "Units",
            "enum": [
              "metric",
              "imperial"
            ],
            "type": "string",
            "description": "Units system for measurement results: metric or imperial. Leave empty to use Brave's default."
          },
          "extraSnippets": {
            "title": "Extra Snippets",
            "type": "boolean",
            "description": "Include additional context snippets from Brave API (beta feature). Provides more text context per result.",
            "default": false
          },
          "includeRawResponse": {
            "title": "Include Raw Response",
            "type": "boolean",
            "description": "Include the full raw Brave API JSON response for each query in dataset output.",
            "default": false
          },
          "outputMarkdown": {
            "title": "Output Markdown",
            "type": "boolean",
            "description": "Convert snippets to clean Markdown format suitable for LLM context injection. Adds descriptionMarkdown field to each result.",
            "default": false
          },
          "deduplicateResults": {
            "title": "Deduplicate Results",
            "type": "boolean",
            "description": "Remove duplicate URLs across queries and pages.",
            "default": true
          },
          "includeInfobox": {
            "title": "Include Infobox",
            "type": "boolean",
            "description": "Include Brave's knowledge panel / infobox data when available (entity info, Wikipedia summaries).",
            "default": true
          },
          "includeDiscussions": {
            "title": "Include Discussions",
            "type": "boolean",
            "description": "Include Reddit/forum discussion results when returned by Brave.",
            "default": true
          },
          "includeFAQs": {
            "title": "Include FAQs",
            "type": "boolean",
            "description": "Include FAQ snippets when Brave returns structured Q&A data.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum concurrent Brave API requests. Minimum 1, maximum 10. Free tier is rate-limited to 1 req/sec — keep at 1 for free tier.",
            "default": 5
          },
          "requestDelay": {
            "title": "Request Delay (ms)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Delay in milliseconds between API requests to avoid rate limiting. Minimum 0, maximum 5000.",
            "default": 200
          },
          "retryCount": {
            "title": "Retry Count",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Number of retries on rate limit (429) or server error (5xx). Uses exponential backoff.",
            "default": 3
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}