{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets Import & Export: Sync Datasets, Update Rows",
    "description": "Send any Apify dataset or JSON to Google Sheets: append, replace, or update rows by a unique key (price and stock monitoring). No OAuth: share the sheet once. Auto-retries on Google limits, one tab per day, dedupe, column picking. Also reads sheets back to JSON.",
    "version": "0.1",
    "x-build-id": "Y06p4hOMWmWtK3M5f"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~google-sheets-import-export/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-google-sheets-import-export",
        "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/s_actors~google-sheets-import-export/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-google-sheets-import-export",
        "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/s_actors~google-sheets-import-export/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-google-sheets-import-export",
        "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": [
          "spreadsheetId"
        ],
        "properties": {
          "spreadsheetId": {
            "title": "📄 Google Sheet",
            "type": "string",
            "description": "Link to your Google Sheet (or just its ID). Share the sheet once with import@sheets-sync-509808.iam.gserviceaccount.com as Editor (Share → paste the e-mail → Editor). The prefilled link is our demo sheet: it lets you try the Actor, writes at most 50 rows into its \"Demo\" tab and replaces them every run. Use your own sheet for real work."
          },
          "mode": {
            "title": "⚙️ Mode",
            "enum": [
              "append",
              "update",
              "replace",
              "read"
            ],
            "type": "string",
            "description": "append: add rows at the end. update: rows with the same unique key are updated in place, new ones added (price and stock monitoring). replace: overwrite the tab. read: sheet → JSON dataset.",
            "default": "append"
          },
          "sheetName": {
            "title": "🗂 Tab name",
            "type": "string",
            "description": "Tab to write to or read from. Created automatically if it doesn't exist. Use {date} for one tab per day, e.g. \"Prices {date}\". Leave empty for the first tab (or the tab in your link)."
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "Apify dataset to import. As an integration after a scraper use {{resource.defaultDatasetId}}."
          },
          "rawData": {
            "title": "Raw data (JSON)",
            "type": "array",
            "description": "Instead of a dataset: an array of objects, or an array of arrays where the first array is the header. Handy for AI agents and API calls."
          },
          "limit": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Take at most this many items from the dataset. Empty = all."
          },
          "offset": {
            "title": "Skip items",
            "minimum": 0,
            "type": "integer",
            "description": "Skip this many items at the start of the dataset.",
            "default": 0
          },
          "deduplicateByField": {
            "title": "Unique key column(s)",
            "type": "string",
            "description": "Column that identifies a row, e.g. url or id (several: \"hotelId,checkInDate\"). append: rows whose key is already in the sheet are skipped. update: rows with this key are updated in place."
          },
          "columnsOrder": {
            "title": "Columns first (order)",
            "type": "array",
            "description": "These columns come first, in this order; the rest follow in the order they appear in the data. Nested fields use \"/\", e.g. address/city.",
            "items": {
              "type": "string"
            }
          },
          "onlyListedColumns": {
            "title": "Only these columns",
            "type": "boolean",
            "description": "Write only the columns listed above and drop the rest.",
            "default": false
          },
          "excludeColumns": {
            "title": "Drop columns",
            "type": "array",
            "description": "Columns to leave out. A name also drops its nested fields: \"offers\" drops offers/0/price, offers/1/price...",
            "items": {
              "type": "string"
            }
          },
          "arrayMode": {
            "title": "Lists in the data",
            "enum": [
              "join",
              "columns",
              "json"
            ],
            "type": "string",
            "description": "How lists like [\"wifi\", \"pool\"] become cells.",
            "default": "join"
          },
          "addTimestamp": {
            "title": "Add \"exportedAt\" column",
            "type": "boolean",
            "description": "Adds the run time (UTC) to every row. Useful for price history with append.",
            "default": false
          },
          "formatHeader": {
            "title": "Bold, frozen header row",
            "type": "boolean",
            "description": "Formats the header when the Actor creates it.",
            "default": true
          },
          "parseValues": {
            "title": "Let Google parse values",
            "type": "boolean",
            "description": "Off (default): values are written exactly as they are: numbers as numbers, text as text, IDs keep leading zeros, and text starting with \"=\" is never run as a formula. On: Google interprets values like typed by hand (dates, formulas, percentages).",
            "default": false
          },
          "headerRow": {
            "title": "Header row (read mode)",
            "minimum": 1,
            "type": "integer",
            "description": "Row with column names when reading a sheet.",
            "default": 1
          },
          "serviceAccountKey": {
            "title": "Your own service account key (optional)",
            "type": "string",
            "description": "Paste the JSON key of your own Google Cloud service account to use it instead of the Actor's shared e-mail. Stored encrypted."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}