{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets Export & Import (No Google Account Linking)",
    "description": "Google Sheets integration for Apify: export any dataset to a Google Sheet after every run, or import a tab into a dataset. Works through a small script in your own spreadsheet: no Google account linking, no Cloud project, no API keys. Append, replace, or add only new rows.",
    "version": "0.1",
    "x-build-id": "kZ9XDuzWpisbPcdRK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yaroslav1~google-sheets-export/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yaroslav1-google-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/yaroslav1~google-sheets-export/runs": {
      "post": {
        "operationId": "runs-sync-yaroslav1-google-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/yaroslav1~google-sheets-export/run-sync": {
      "post": {
        "operationId": "run-sync-yaroslav1-google-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": {
          "webAppUrl": {
            "title": "Web app URL",
            "type": "string",
            "description": "The link of the bridge script in your spreadsheet. It looks like <code>https://script.google.com/macros/s/…/exec</code>. To get it, paste the script from the README into Extensions → Apps Script, then Deploy → New deployment → Web app (Execute as: Me, Who has access: Anyone). <b>Leave this empty and run once</b> to get a setup page with the script and a personal token."
          },
          "token": {
            "title": "Token",
            "type": "string",
            "description": "The same secret as in the TOKEN line at the top of the bridge script (16+ characters)."
          },
          "sheetName": {
            "title": "Tab name",
            "type": "string",
            "description": "The tab (sheet) of the spreadsheet to write to or read from. It is created when it does not exist yet.",
            "default": "Apify"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "append",
              "replace",
              "read"
            ],
            "type": "string",
            "description": "<b>Append</b> adds rows below the existing ones and adds new columns on the right. <b>Replace</b> clears the tab, then writes the dataset (an empty dataset leaves the tab as it is). <b>Import</b> copies the tab into this run's dataset.",
            "default": "append"
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "The dataset to send to the sheet. When you add this Actor as an integration of another Actor, this is filled in for you: <code>{{resource.defaultDatasetId}}</code>."
          },
          "uniqueKey": {
            "title": "Skip rows already in the sheet, by column",
            "type": "string",
            "description": "A column such as <code>url</code> or <code>id</code>. Rows whose value in this column is already in the tab (or earlier in the dataset) are skipped and not charged. Leave empty to write every row."
          },
          "fields": {
            "title": "Only these fields",
            "type": "array",
            "description": "Send only these top-level fields of the dataset, in this order. Leave empty to send all fields.",
            "items": {
              "type": "string"
            }
          },
          "omitFields": {
            "title": "Leave out these fields",
            "type": "array",
            "description": "Top-level fields not to send, for example long <code>html</code> or <code>text</code> fields.",
            "items": {
              "type": "string"
            }
          },
          "nested": {
            "title": "Nested data",
            "enum": [
              "columns",
              "json"
            ],
            "type": "string",
            "description": "How objects and lists inside items become cells. <b>Columns</b> works like Apify's CSV export: <code>address/city</code>, <code>images/0</code>, <code>images/1</code>. <b>JSON</b> keeps each field in one cell as JSON text.",
            "default": "columns"
          },
          "textValues": {
            "title": "Text values",
            "enum": [
              "smart",
              "text",
              "sheets"
            ],
            "type": "string",
            "description": "<b>Smart</b>: text such as \"19.99\" becomes a number, everything else stays exactly as it is (leading zeros, long IDs, phone numbers, dates). <b>Text</b>: all text stays text. <b>Like typing</b>: Google Sheets turns text into dates, percents and currencies the way it does when you type, which depends on the spreadsheet's locale. Formulas are never run in any mode.",
            "default": "smart"
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows. Leave empty for all rows."
          },
          "dryRun": {
            "title": "Check only",
            "type": "boolean",
            "description": "Test the settings without writing anything: checks the connection and the token, and shows the first rows as they would look in the sheet. No rows are charged.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}