{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets Sync",
    "description": "Send any Apify dataset to Google Sheets: append, replace, or upsert by key without duplicates. New fields become new columns, quota limits are retried automatically, and sheets can be read back into datasets.",
    "version": "1.0",
    "x-build-id": "vfsPBOxgJQZJqDqM3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rsiddiq95~google-sheets-sync/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rsiddiq95-google-sheets-sync",
        "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/rsiddiq95~google-sheets-sync/runs": {
      "post": {
        "operationId": "runs-sync-rsiddiq95-google-sheets-sync",
        "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/rsiddiq95~google-sheets-sync/run-sync": {
      "post": {
        "operationId": "run-sync-rsiddiq95-google-sheets-sync",
        "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": [
          "spreadsheet"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "append",
              "replace",
              "upsert",
              "read"
            ],
            "type": "string",
            "description": "Append adds rows at the bottom. Replace clears the tab first. Upsert updates rows with a matching key and adds the rest. Read copies the sheet into the dataset.",
            "default": "append"
          },
          "spreadsheet": {
            "title": "Spreadsheet URL",
            "type": "string",
            "description": "The Google Sheets URL from your browser, or just the spreadsheet ID."
          },
          "sheetName": {
            "title": "Tab name",
            "type": "string",
            "description": "Name of the tab to use. Leave empty for the first tab.",
            "default": ""
          },
          "serviceAccountKey": {
            "title": "Google service account key (JSON)",
            "type": "string",
            "description": "Paste the full contents of a service account JSON key, then share the spreadsheet with the service account's email as an Editor. Stored encrypted. Not needed for reading a public sheet."
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Apify dataset to send, for example from another Actor's run. In an integration, use {{resource.defaultDatasetId}}.",
            "default": ""
          },
          "rawData": {
            "title": "Raw JSON data",
            "type": "array",
            "description": "Alternatively, a JSON array of objects to send, for example [{\"name\": \"A\", \"price\": 10}]."
          },
          "keyColumns": {
            "title": "Key columns (upsert)",
            "type": "array",
            "description": "Columns that identify a row, for example url or id. Rows with the same key values are updated instead of duplicated.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "title": "Only these fields",
            "type": "array",
            "description": "Send only these fields. Nested fields are included with their parent (address includes address/city).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "omitFields": {
            "title": "Skip these fields",
            "type": "array",
            "description": "Fields to leave out.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "columnsOrder": {
            "title": "Columns first",
            "type": "array",
            "description": "New columns listed here are placed first, in this order. Existing columns never move.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "offset": {
            "title": "Skip first items",
            "minimum": 0,
            "type": "integer",
            "description": "Number of dataset items to skip.",
            "default": 0
          },
          "limit": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of items to send. 0 means all.",
            "default": 0
          },
          "keepColumnOrder": {
            "title": "Keep existing column order (replace)",
            "type": "boolean",
            "description": "In replace mode, keep the tab's current columns and their order instead of starting fresh.",
            "default": true
          },
          "parseValues": {
            "title": "Let Google interpret values",
            "type": "boolean",
            "description": "When on, Google turns text like 2026-01-31 or 10% into dates and numbers, and text starting with = into formulas. Leave off for scraped data, so nothing in it can run as a formula.",
            "default": false
          },
          "createSheetIfMissing": {
            "title": "Create the tab if missing",
            "type": "boolean",
            "description": "Create the named tab when it does not exist yet.",
            "default": true
          },
          "publicSheet": {
            "title": "Public sheet (read mode)",
            "type": "boolean",
            "description": "Read a sheet shared as 'Anyone with the link' without a service account key.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}