{
  "openapi": "3.0.1",
  "info": {
    "title": "RAG Web Search - Search the Web, Get Markdown for AI Agents",
    "description": "Search the web and get the top result pages as clean Markdown for LLMs, RAG and AI agents, in one call. $0.001 per page returned: the search is free, failed pages are replaced and never charged. Content is cut to fit a context window, with a token estimate per page.",
    "version": "0.1",
    "x-build-id": "ZpfuiOpKtPybeb7dk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rjmacarthy~rag-web-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rjmacarthy-rag-web-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/rjmacarthy~rag-web-search/runs": {
      "post": {
        "operationId": "runs-sync-rjmacarthy-rag-web-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/rjmacarthy~rag-web-search/run-sync": {
      "post": {
        "operationId": "run-sync-rjmacarthy-rag-web-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Search queries or URLs",
            "type": "array",
            "description": "One search query per line. Each query is searched on the web (DuckDuckGo) and its top result pages are returned as Markdown. A line that is an http(s) URL is fetched directly, without a search.",
            "default": [
              "what is retrieval augmented generation"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Pages per query",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many result pages to fetch and return for each query (max 10; 0 = 10). Each page returned is one charged event ($0.001); the search itself is free. A page that fails, times out or is not HTML is replaced by the next search result and is not charged.",
            "default": 3
          },
          "maxContentChars": {
            "title": "Max content characters per page",
            "minimum": 0,
            "type": "integer",
            "description": "Cut each page's Markdown (and text) at a paragraph boundary so a result fits an LLM context window: 20,000 characters is about 5,000 tokens. 0 = no limit.",
            "default": 20000
          },
          "freshness": {
            "title": "Freshness",
            "enum": [
              "any",
              "day",
              "week",
              "month"
            ],
            "type": "string",
            "description": "Only search results dated within this period. If the fallback search (Bing) ignores the filter for a run, the Actor returns an uncharged row with the reason instead of wrong pages.",
            "default": "any"
          },
          "country": {
            "title": "Country",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "NZ",
              "IE",
              "IN",
              "SG",
              "ZA",
              "PH",
              "MY",
              "DE",
              "AT",
              "CH",
              "FR",
              "BE",
              "NL",
              "ES",
              "MX",
              "AR",
              "CL",
              "IT",
              "BR",
              "PT",
              "PL",
              "SE",
              "DK",
              "NO",
              "FI",
              "TR",
              "RU",
              "JP",
              "KR",
              "CN",
              "HK",
              "TW",
              "SA"
            ],
            "type": "string",
            "description": "Country to search in.",
            "default": "US"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Two-letter language of the search, e.g. en, de, fr, es. Together with the country it selects the search region (de + DE = de-DE). If there is no market for the pair, the country's main language is used.",
            "default": "en"
          },
          "skipDomains": {
            "title": "Skip domains",
            "type": "array",
            "description": "Search results on these domains (and their subdomains) are skipped, e.g. youtube.com, pinterest.com.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "Which content fields to fill: markdown (default), text, html. The price per page is the same.",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "html"
              ],
              "enumTitles": [
                "Markdown",
                "Plain text",
                "Cleaned HTML"
              ]
            },
            "default": [
              "markdown"
            ]
          },
          "includeLinks": {
            "title": "Keep links in the Markdown",
            "type": "boolean",
            "description": "On: links stay as [text](https://absolute.url). Off: only the link text, which saves tokens.",
            "default": true
          },
          "requestTimeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 3,
            "maximum": 60,
            "type": "integer",
            "description": "Maximum time to wait for one result page. A page that takes longer is replaced by the next search result.",
            "default": 15
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Off by default. Used for fetching result pages (and the Bing fallback search): turn on Apify Proxy (automatic = datacenter) if result pages block the run's IP. Residential proxies are not supported: if you select the RESIDENTIAL group the Actor logs a warning and uses the datacenter proxy instead.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}