{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets Export & Import: Append, Upsert, Dedupe",
    "description": "Send any Apify dataset, JSON or CSV to Google Sheets and read sheets back as JSON. True append that never moves your columns, upsert by key column (no duplicates), replace, automatic retries on Google limits. Just share your sheet with our robot; no login that expires.",
    "version": "0.1",
    "x-build-id": "OKpFJ5EvJNoLTHC1r"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/weav3rx~google-sheets-export-import/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-weav3rx-google-sheets-export-import",
        "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/weav3rx~google-sheets-export-import/runs": {
      "post": {
        "operationId": "runs-sync-weav3rx-google-sheets-export-import",
        "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/weav3rx~google-sheets-export-import/run-sync": {
      "post": {
        "operationId": "run-sync-weav3rx-google-sheets-export-import",
        "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",
          "mode"
        ],
        "properties": {
          "spreadsheet": {
            "title": "Spreadsheet",
            "pattern": "^(https://docs\\.google\\.com/spreadsheets/d/[a-zA-Z0-9-_]{20,}.*|[a-zA-Z0-9-_]{20,})$",
            "type": "string",
            "description": "Link to your Google Sheet (or its ID). First click Share in the sheet and add sheets-robot@calm-scarab-515602-k6.iam.gserviceaccount.com as an Editor (Viewer is enough for import)."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "append",
              "upsert",
              "replace",
              "import"
            ],
            "type": "string",
            "description": "Append adds rows at the end. Upsert updates rows whose key column matches and appends the rest (no duplicates). Replace clears the sheet and writes fresh data. Import reads the sheet into the dataset as JSON.",
            "default": "append"
          },
          "sheetName": {
            "title": "Sheet (tab) name",
            "type": "string",
            "description": "Tab to use. Leave empty for the tab in your link (#gid) or the first tab. For export, a missing tab is created."
          },
          "dataset": {
            "title": "Data: Apify dataset",
            "type": "string",
            "description": "Pick a dataset to export, e.g. the results of another Actor run. In integrations, use the run's default dataset ID."
          },
          "jsonData": {
            "title": "Data: JSON",
            "type": "array",
            "description": "Or paste data directly: an array of objects, or an array of arrays with a header row first."
          },
          "dataUrl": {
            "title": "Data: URL of a JSON or CSV file",
            "type": "string",
            "description": "Or a public link to a JSON array or a CSV file."
          },
          "keyColumns": {
            "title": "Key column(s) for upsert",
            "type": "array",
            "description": "Field(s) that identify a row, e.g. url, id or email. Rows with the same key are updated instead of duplicated. Several fields = combined key.",
            "items": {
              "type": "string"
            }
          },
          "columns": {
            "title": "Column order",
            "type": "array",
            "description": "Optional. Fields to put first, in this order (nested fields use dots, e.g. address.city). Existing sheet columns always keep their position.",
            "items": {
              "type": "string"
            }
          },
          "onlySelectedColumns": {
            "title": "Only the columns listed above",
            "type": "boolean",
            "description": "Write only the fields listed in Column order (plus columns that already exist in the sheet).",
            "default": false
          },
          "parseValues": {
            "title": "Let Google parse values (dates, formulas)",
            "type": "boolean",
            "description": "Off (recommended): text is written exactly as is, so scraped text starting with = can't turn into a formula. On: Google interprets values like you typed them (dates, percentages, formulas).",
            "default": false
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Upper limit of rows written (export) or read (import) in one run.",
            "default": 1000000
          },
          "serviceAccountJson": {
            "title": "Your own Google service account key (optional)",
            "type": "string",
            "description": "Only if you prefer your own robot account: paste the whole service-account .json key. Then share the sheet with that account's e-mail instead."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}