{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset to Google Sheets (no OAuth)",
    "description": "Send any Apify dataset into your Google Sheet. Share the sheet once with our service account: no Google sign-in, no expiring tokens. True append, replace or upsert by key, stable columns, automatic grid growth, retries on Google rate limits. Works after every scraper run as an integration.",
    "version": "1.0",
    "x-build-id": "dtc0DPKlWPJLCpjib"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rivetfinch~sheets-export/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rivetfinch-sheets-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/rivetfinch~sheets-export/runs": {
      "post": {
        "operationId": "runs-sync-rivetfinch-sheets-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/rivetfinch~sheets-export/run-sync": {
      "post": {
        "operationId": "run-sync-rivetfinch-sheets-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",
        "properties": {
          "spreadsheet": {
            "title": "Spreadsheet (address or ID)",
            "type": "string",
            "description": "The address of your Google Sheet from the browser bar, for example https://docs.google.com/spreadsheets/d/1AbC.../edit#gid=0, or just its ID (any length). If the address points at a tab (#gid=...), that tab is used."
          },
          "sheetName": {
            "title": "Sheet (tab) name",
            "type": "string",
            "description": "Which tab to write to. Created if it doesn't exist. Leave empty to use the tab in the address, or else the first tab."
          },
          "dataset": {
            "title": "Dataset",
            "type": "string",
            "description": "The dataset to export. When this Actor runs as an integration after another Actor's run, this is filled in for you with that run's dataset."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "append",
              "replace",
              "upsert"
            ],
            "type": "string",
            "description": "Append adds the dataset's rows after the last row in the tab and never touches existing rows. Replace clears the tab's values (formatting stays) and writes the dataset. Upsert updates rows whose key columns match and appends the rest.",
            "default": "append"
          },
          "keyColumns": {
            "title": "Key columns",
            "type": "array",
            "description": "Column names that identify a row, such as url or id (use the flattened name for nested fields, for example author.id). Needed for Upsert and for skipping rows already in the sheet.",
            "items": {
              "type": "string"
            }
          },
          "skipExistingKeys": {
            "title": "Append: skip rows whose key is already in the sheet",
            "type": "boolean",
            "description": "In Append mode, don't add a row when a row with the same key columns is already in the tab (or earlier in this run). Skipped rows are not charged.",
            "default": false
          },
          "columns": {
            "title": "Columns (order and selection)",
            "type": "array",
            "description": "Only write these columns, in this order for a new tab. Leave empty to write every field. Columns already in the sheet keep their place; listed columns the sheet lacks are added at the end.",
            "items": {
              "type": "string"
            }
          },
          "keepColumnOrder": {
            "title": "Replace: keep the existing column order",
            "type": "boolean",
            "description": "In Replace mode, keep the tab's current header and column order (charts and formulas keep working); fields not in it are added at the end. Turn off to write a fresh header in the dataset's own order.",
            "default": true
          },
          "valueInputOption": {
            "title": "How Google reads the values",
            "enum": [
              "RAW",
              "USER_ENTERED"
            ],
            "type": "string",
            "description": "Raw stores text exactly as it is. As typed lets Google turn text into numbers and dates as if you typed it in the sheet (formulas only if you allow them below). Raw is safer for keys and IDs.",
            "default": "RAW"
          },
          "allowFormulas": {
            "title": "As typed: allow formulas",
            "type": "boolean",
            "description": "Only with 'As typed'. Off (safer): text starting with = is stored as text, so scraped data can't run formulas in your sheet. On: such text becomes a live formula.",
            "default": false
          },
          "flattenArrays": {
            "title": "Arrays",
            "enum": [
              "join",
              "json",
              "index"
            ],
            "type": "string",
            "description": "Nested objects always become columns such as author.name. For arrays: Join puts a list of plain values into one cell (a, b, c) and spreads lists of objects over numbered columns; JSON puts each array into one cell as JSON text; Numbered columns gives every element its own column (tags.0, tags.1).",
            "default": "join"
          },
          "arraySeparator": {
            "title": "Separator for joined arrays",
            "type": "string",
            "description": "Text placed between joined array values.",
            "default": ", "
          },
          "nestedSeparator": {
            "title": "Separator in nested column names",
            "type": "string",
            "description": "Joins nested field names into one column name: author.name with a dot, author/name with a slash.",
            "default": "."
          },
          "offset": {
            "title": "Skip the first N items",
            "minimum": 0,
            "type": "integer",
            "description": "Start reading the dataset after this many items.",
            "default": 0
          },
          "limit": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Read at most this many items from the dataset. 0 means all. The run's maximum cost is also respected.",
            "default": 0
          },
          "serviceAccountKey": {
            "title": "Your own service account key (optional)",
            "type": "string",
            "description": "Paste a Google service-account JSON key to write with your own service account instead of ours. Share the sheet with that account's email as Editor. No link code is needed then. Stored encrypted."
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Filled in by Apify when this Actor runs as an integration after another Actor's run. The triggering run's dataset is used when Dataset is empty."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}