{
  "openapi": "3.0.1",
  "info": {
    "title": "Gemini API Answers: Sources & Citations in Bulk",
    "description": "Gemini answers with cited sources from Google's Gemini API with Google Search, not the Gemini app (answers can differ). Real page links, not expiring redirects. Inputs: questions, fileUrl (CSV or Sheet), datasetId, country, brands, competitors, monitor. Charged only per answer.",
    "version": "0.1",
    "x-build-id": "Fcmc6YnHIGH9QejKA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~gemini-api-answers/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-gemini-api-answers",
        "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/nerolabs~gemini-api-answers/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-gemini-api-answers",
        "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/nerolabs~gemini-api-answers/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-gemini-api-answers",
        "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": {
          "questions": {
            "title": "Questions",
            "type": "array",
            "description": "The questions or search queries to ask Gemini, one per line. Each one returns the full answer from Google's Gemini API with Google Search, with its cited sources, and is charged once, only when an answer with text comes back. Or give a CSV, Google Sheet or dataset below instead.",
            "items": {
              "type": "string"
            }
          },
          "fileUrl": {
            "title": "File or Google Sheet URL",
            "type": "string",
            "description": "A public link to a CSV, TSV, Excel, JSON or JSON Lines file with one question per row. A normal Google Sheets link works (share it as 'Anyone with the link can view'). Every other column is kept on the output row. Used when 'Questions' is empty."
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "An Apify dataset with one question per row, for example a keyword list from another Actor. Every original column is kept. Use the picker rather than typing an ID. Used when 'Questions' and 'File or Google Sheet URL' are empty."
          },
          "questionField": {
            "title": "Question column",
            "type": "string",
            "description": "For a file or dataset: the column that holds the question. Leave empty to detect it (looks for question, query, prompt, keyword)."
          },
          "questionTemplate": {
            "title": "Question template",
            "type": "string",
            "description": "Optional. Turns each row into a full question, for example 'Best CRM for {question}' with a row 'real estate agents'. {question} is replaced by the row's text. Useful when a sheet holds keywords, not questions."
          },
          "fileFormat": {
            "title": "File format",
            "enum": [
              "auto",
              "csv",
              "tsv",
              "json",
              "jsonl",
              "xlsx"
            ],
            "type": "string",
            "description": "Leave on auto unless the file is detected wrongly.",
            "default": "auto"
          },
          "sheetName": {
            "title": "Excel sheet name",
            "type": "string",
            "description": "For an Excel file: which sheet to read. Leave empty for the first sheet."
          },
          "model": {
            "title": "Gemini model",
            "enum": [
              "gemini-3.1-flash-lite",
              "gemini-3.8-flash"
            ],
            "type": "string",
            "description": "gemini-3.1-flash-lite is fast and cheap (about $0.03 of model and Google Search cost per answer with one search, billed to your Apify account by Apify's OpenRouter proxy). gemini-3.8-flash is the stronger model, about the same cost and a few seconds slower. If the chosen model is unavailable the other one is tried once.",
            "default": "gemini-3.1-flash-lite"
          },
          "searchDepth": {
            "title": "Web searches per question",
            "enum": [
              "one",
              "auto"
            ],
            "type": "string",
            "description": "'one' asks Gemini to run one Google Search per question (fastest and cheapest, about $0.03 model cost; Gemini sometimes still runs two). 'auto' lets Gemini search as often as it wants, like the Gemini app can (usually 2 to 3 searches, about $0.03 to $0.045).",
            "default": "one"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Optional two-letter country code (US, GB, DE) so Gemini answers as for a user in that country. A 'country' column in the file overrides it per row."
          },
          "language": {
            "title": "Answer language",
            "type": "string",
            "description": "Optional, for example 'Spanish' or 'German'. The answer is written in this language; the question can be in any language."
          },
          "systemPrompt": {
            "title": "Extra instructions",
            "type": "string",
            "description": "Optional style instruction added to every question, for example 'Answer in 3 bullet points' or 'Name at least 5 products'. To change what is asked, use 'Question template'."
          },
          "brands": {
            "title": "Your brand names",
            "type": "array",
            "description": "Optional. Your brand or product names, for example 'HubSpot'. Each answer reports brandMentioned and brandPosition (1 = named first among all your brands and competitors that appear).",
            "items": {
              "type": "string"
            }
          },
          "domains": {
            "title": "Your website domains",
            "type": "array",
            "description": "Optional. Your website domains, for example 'hubspot.com'. Each answer lists ownDomainsCited with the position of each cited page.",
            "items": {
              "type": "string"
            }
          },
          "competitors": {
            "title": "Competitors",
            "type": "array",
            "description": "Optional. Competitor names or domains, for example 'Salesforce'. Each answer lists competitorsMentioned in the order named, and the summary ranks them by share of answers.",
            "items": {
              "type": "string"
            }
          },
          "monitor": {
            "title": "Monitor mode",
            "type": "boolean",
            "description": "Remember each question's last answer (in a named key-value store on your account) and, on the next run, mark only what changed: new and dropped sources (isNew on each citation), newly cited or dropped sites, and brand or competitor mentions gained or lost. Schedule the run daily or weekly. Off by default.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Keeps separate monitors apart, for example one per client. Letters, numbers and dashes.",
            "default": "default"
          },
          "onlyChanged": {
            "title": "Only output changed questions",
            "type": "boolean",
            "description": "In monitor mode, write only rows that are new or changed since the last run. Every answered question is still charged once, because Gemini was asked.",
            "default": false
          },
          "keepOriginalFields": {
            "title": "Keep original columns",
            "type": "boolean",
            "description": "Copy every other column of the input row onto the output row.",
            "default": true
          },
          "concurrency": {
            "title": "Questions at once",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many questions are asked at the same time.",
            "default": 5
          },
          "maxItems": {
            "title": "Max questions",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many rows from the source."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}