{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets Import & Export: Datasets to Sheets and Back",
    "description": "Import any Google Sheet into a dataset (public link, no login) or export an Apify dataset to a sheet: append or replace, one row per record. Service account or token.",
    "version": "0.1",
    "x-build-id": "C6ishgGuF3mkRve02"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/transparent_meteorite~google-sheets-import-export/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-transparent_meteorite-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/transparent_meteorite~google-sheets-import-export/runs": {
      "post": {
        "operationId": "runs-sync-transparent_meteorite-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/transparent_meteorite~google-sheets-import-export/run-sync": {
      "post": {
        "operationId": "run-sync-transparent_meteorite-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "import",
              "export"
            ],
            "type": "string",
            "description": "Import reads a Google Sheet and returns one dataset row per sheet row. Export writes an Apify dataset into a sheet.",
            "default": "import"
          },
          "spreadsheetUrl": {
            "title": "Spreadsheet link or ID",
            "type": "string",
            "description": "The full Google Sheets URL, or just the ID between /d/ and /edit. A #gid=123 at the end selects that tab."
          },
          "sheetName": {
            "title": "Tab name",
            "type": "string",
            "description": "Tab to read or write. Import: first tab if empty. Export: first tab if empty; a missing tab is created."
          },
          "range": {
            "title": "Range (import)",
            "type": "string",
            "description": "Optional A1 range to read, for example A1:F100 or B2:D. Empty reads the whole tab."
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Import: stop after this many data rows. Export: write at most this many dataset items.",
            "default": 10000
          },
          "hasHeader": {
            "title": "First row is a header",
            "type": "boolean",
            "description": "Import: use row 1 as field names. If off, fields are named A, B, C.",
            "default": true
          },
          "convertTypes": {
            "title": "Convert numbers and booleans",
            "type": "boolean",
            "description": "Import: turn 42, 3.5, TRUE and FALSE into real numbers and booleans. Text such as 007 stays text. Empty cells become null.",
            "default": true
          },
          "skipEmptyRows": {
            "title": "Skip empty rows",
            "type": "boolean",
            "description": "Import: leave out rows where every cell is empty.",
            "default": true
          },
          "trackChanges": {
            "title": "Track changes since the last run (import)",
            "type": "boolean",
            "description": "Marks every row as new, changed or unchanged compared with the previous run on the same sheet, tab and range. The baseline is kept in a key-value store named sheets-import-row-state in your account.",
            "default": false
          },
          "onlyChanged": {
            "title": "Return only new and changed rows (import)",
            "type": "boolean",
            "description": "Skips rows that did not change since the last run. Turns on change tracking. Rows are charged only when returned.",
            "default": false
          },
          "keyColumn": {
            "title": "Key column (import, change tracking)",
            "type": "string",
            "description": "Column header that identifies a row, for example id or email. With a key, inserting or sorting rows does not mark everything as changed. Empty means rows are matched by row number."
          },
          "datasetId": {
            "title": "Dataset ID or URL (export)",
            "type": "string",
            "description": "Export only: the Apify dataset to write, for example the default dataset of another run. It must belong to your account."
          },
          "writeMode": {
            "title": "Write mode (export)",
            "enum": [
              "append",
              "replace"
            ],
            "type": "string",
            "description": "Append adds rows under the existing data and matches columns by header name. Replace clears the tab first.",
            "default": "append"
          },
          "columns": {
            "title": "Columns (export)",
            "type": "array",
            "description": "Optional list of dataset fields to write, in this order. Nested fields use dots, like address.city. Empty writes every field.",
            "items": {
              "type": "string"
            }
          },
          "createSheetIfMissing": {
            "title": "Create the tab if missing (export)",
            "type": "boolean",
            "description": "Export: add the tab when it does not exist.",
            "default": true
          },
          "interpretFormulas": {
            "title": "Interpret formulas and dates (export)",
            "type": "boolean",
            "description": "Off writes values exactly as given (safe). On lets Sheets parse values like =SUM(A1:A3) and 2026-11-16, which also lets untrusted text run as a formula.",
            "default": false
          },
          "serviceAccountJson": {
            "title": "Service account JSON",
            "type": "string",
            "description": "Paste the full key file of a Google service account. Share the sheet with its client_email (Viewer to import private sheets, Editor to export). Stored encrypted and never printed."
          },
          "accessToken": {
            "title": "OAuth access token",
            "type": "string",
            "description": "Alternative to a service account: a Google OAuth access token with the spreadsheets scope. Tokens expire after about an hour."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}