{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets URL Monitor Actor",
    "description": "Google Sheets URL Monitor turns a plain spreadsheets into a **no-code web monitoring dashboard**. It reads the URLs listed in your sheet's `URL` column, visits each page in a real browser, extracts the values you care about (prices, titles), and writes the fresh values straight back into the sheet.",
    "version": "0.0",
    "x-build-id": "i4rESptZn6q3TIrUe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dtrungtin~google-sheets-url-monitor-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dtrungtin-google-sheets-url-monitor-actor",
        "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/dtrungtin~google-sheets-url-monitor-actor/runs": {
      "post": {
        "operationId": "runs-sync-dtrungtin-google-sheets-url-monitor-actor",
        "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/dtrungtin~google-sheets-url-monitor-actor/run-sync": {
      "post": {
        "operationId": "run-sync-dtrungtin-google-sheets-url-monitor-actor",
        "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": [
          "spreadsheetUrl"
        ],
        "properties": {
          "spreadsheetUrl": {
            "title": "Spreadsheet URL",
            "type": "string",
            "description": "Full URL of the Google Sheet to monitor. Row 1 must be a header row containing a column named <code>URL</code>. Every other non-empty header is either a CSS selector whose extracted text is written into that column, or a plain field name (e.g. <code>Price</code>) that is extracted by AI when an OpenAI API key is provided."
          },
          "googleServiceAccountKey": {
            "title": "Google service account key (JSON)",
            "type": "string",
            "description": "Contents of a Google Cloud service account JSON key file with the Sheets API enabled. Share the spreadsheet with the service account's <code>client_email</code> as an Editor. If omitted, the Actor runs in read-only mode: it reads a link-shared sheet via CSV export and stores results only in the dataset."
          },
          "openaiApiKey": {
            "title": "OpenAI API key",
            "type": "string",
            "description": "Enables AI extraction for columns whose header is a plain field name (e.g. <code>Price</code>) instead of a CSS selector. The rendered page text is sent to OpenAI, which returns the requested fields. If omitted, the <code>OPENAI_API_KEY</code> environment variable is used instead (set it as a secret environment variable in the Actor settings, or in a local <code>.env</code> file). Without either, such columns are left untouched."
          },
          "openaiModel": {
            "title": "OpenAI model",
            "type": "string",
            "description": "OpenAI model used for AI extraction of plain-name columns.",
            "default": "gpt-5.4-mini"
          },
          "aiPrompt": {
            "title": "AI extraction prompt",
            "type": "string",
            "description": "Optional instructions guiding how the AI fills the plain-name columns, e.g. <code>Price must be a plain number without currency symbols. Availability is either 'In stock' or 'Out of stock'. Answer in English.</code>"
          },
          "updatedColumnName": {
            "title": "Updated column name",
            "type": "string",
            "description": "Name of the header column that receives the timestamp of the last successful update.",
            "default": "UPDATED"
          },
          "selectorTimeoutSecs": {
            "title": "Selector timeout (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "How long to wait for each CSS selector to appear on the page before treating it as missing. Selectors are awaited concurrently, so this bounds the extra wait per page.",
            "default": 8
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of pages processed in parallel. Keep low (1-5) since each page runs in a full browser.",
            "default": 3
          },
          "maxRequestRetries": {
            "title": "Max request retries",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How many times a blocked or failed page is retried before its row is skipped. Sites like eBay often return 403 a few times before letting a request through - raise this if such rows keep failing.",
            "default": 3
          },
          "sameDomainDelaySecs": {
            "title": "Same-domain delay (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Minimum delay between two requests to the same website. Spacing out hits to bot-protected sites (eBay, Amazon) reduces 403 blocks.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings, useful for sites with anti-bot protection (e.g. eBay).",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}