{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets Import & Export | No OAuth, Free Import",
    "description": "Export any Apify dataset or JSON to Google Sheets (append, append only new rows, replace) or import a Google Sheet into a dataset for free. No OAuth, no Google Cloud: public link, Apps Script or service account. Quota-safe retries, exact text, new columns added automatically.",
    "version": "1.0",
    "x-build-id": "4IYvDNR4PgLcPyGvK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikirag3~google-sheets-export/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikirag3-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/mikirag3~google-sheets-export/runs": {
      "post": {
        "operationId": "runs-sync-mikirag3-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/mikirag3~google-sheets-export/run-sync": {
      "post": {
        "operationId": "run-sync-mikirag3-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": {
          "operation": {
            "title": "Operation",
            "enum": [
              "export",
              "import"
            ],
            "type": "string",
            "description": "Export writes rows into a sheet (paid per row written). Import reads a tab or range into this run's dataset, one item per row, using the first row as field names (free, up to 5,000 rows per run).",
            "default": "export"
          },
          "datasetId": {
            "title": "Dataset to export",
            "type": "string",
            "description": "The dataset to write into the sheet, e.g. the results of another Actor run. In an integration (Actor → this Actor), use {{resource.defaultDatasetId}}."
          },
          "rawData": {
            "title": "…or raw JSON data",
            "type": "array",
            "description": "Instead of a dataset: a JSON array of objects (one row each) or of arrays (cells in order). Ignored when a dataset is chosen."
          },
          "authMethod": {
            "title": "How to connect to Google",
            "enum": [
              "appsScript",
              "serviceAccount",
              "public"
            ],
            "type": "string",
            "description": "Apps Script: paste the free bridge script from the README into your sheet and deploy it as a web app. Service account: a Google Cloud service-account JSON key, with the sheet shared to its email. Public link: just paste the sheet's URL below (reading only).",
            "default": "appsScript"
          },
          "appsScriptUrl": {
            "title": "Apps Script web app URL",
            "type": "string",
            "description": "Looks like https://script.google.com/macros/s/…/exec (Deploy > New deployment > Web app). The data goes to the spreadsheet the script is attached to."
          },
          "appsScriptSecret": {
            "title": "Apps Script secret",
            "type": "string",
            "description": "The same password you wrote in the script (const SECRET = '…'). Stored encrypted."
          },
          "serviceAccountKey": {
            "title": "Service account key (JSON)",
            "type": "object",
            "description": "Only for the service-account method: the whole JSON key file. Share the spreadsheet with the key's client_email as Editor. Stored encrypted."
          },
          "spreadsheet": {
            "title": "Spreadsheet URL or ID",
            "type": "string",
            "description": "For the service-account and public-link methods: the full Google Sheets URL (or its ID). For a public link, copy the URL while the tab you want is open (it ends with #gid=…). The Apps Script method always uses its own spreadsheet."
          },
          "sheetName": {
            "title": "Tab name",
            "type": "string",
            "description": "Export: tab to write to, created if missing. Import: tab to read. Empty = the first tab. (Public links pick the tab from the URL's #gid=.)"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "append",
              "append-new",
              "replace"
            ],
            "type": "string",
            "description": "Replace clears the tab only after the first data has been read, so an empty or failed source never wipes your sheet.",
            "default": "append"
          },
          "dedupeKey": {
            "title": "Dedupe key field",
            "type": "string",
            "description": "For 'Append only new rows': the field that identifies an item, e.g. url or id (nested fields with dots: product.sku)."
          },
          "columns": {
            "title": "Columns (optional)",
            "type": "array",
            "description": "Export: write only these fields, in this order (nested fields with dots: price.value); empty = all fields, new fields become new columns at the right. Import: keep only these header names.",
            "items": {
              "type": "string"
            }
          },
          "arrayMode": {
            "title": "Arrays",
            "enum": [
              "join",
              "json",
              "columns"
            ],
            "type": "string",
            "description": "How list fields are written.",
            "default": "join"
          },
          "parseValues": {
            "title": "Let Google convert text (numbers, dates, formulas)",
            "type": "boolean",
            "description": "Off (recommended): text stays exactly as scraped — 00123 keeps its zeros, '=…' is never run as a formula. Numbers and booleans are always written as numbers and booleans.",
            "default": false
          },
          "range": {
            "title": "Range to import (optional)",
            "type": "string",
            "description": "A1 range such as A1:F500 or A:D (Apps Script and service account also accept Tab!A1:F500). Empty = all data on the tab."
          },
          "hasHeader": {
            "title": "First row is the header",
            "type": "boolean",
            "description": "On: the first non-empty row gives the field names (empty names become column3, repeated names get _2). Off: fields are column1, column2…",
            "default": true
          },
          "convertValues": {
            "title": "Convert numbers and TRUE/FALSE",
            "type": "boolean",
            "description": "Off: every cell comes as text exactly as shown in the sheet. On: plain numbers (12, 3.5) become numbers and TRUE/FALSE booleans; codes with leading zeros like 00123 stay text.",
            "default": false
          },
          "offset": {
            "title": "Skip first items",
            "minimum": 0,
            "type": "integer",
            "description": "Export: items of the source to skip. Import: data rows to skip (to continue after a previous run).",
            "default": 0
          },
          "limit": {
            "title": "Maximum items",
            "minimum": 1,
            "type": "integer",
            "description": "Export: empty = all items. Import: empty = up to 5,000 rows."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}