{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Sheets Import Export",
    "description": "Easy way to import and export data from datasets across multiple Google sheets.\n\nApify does not use Google Workspace APIs  to develop, improve, or train generalized AI and/or ML models.",
    "version": "0.1",
    "x-build-id": "a2drCfbjQeL8JbFUJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apify~google-sheets-import-export/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apify-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/apify~google-sheets-import-export/runs": {
      "post": {
        "operationId": "runs-sync-apify-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/apify~google-sheets-import-export/run-sync": {
      "post": {
        "operationId": "run-sync-apify-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": {
          "oAuthAccount.wrhyqVCM1DRfhvEJm": {
            "title": "Google Account Id",
            "type": "string",
            "description": "Google Account Id"
          },
          "sheetId.wrhyqVCM1DRfhvEJm": {
            "title": "Spreadsheet id",
            "type": "string",
            "description": "Spreadsheet from where the old data will be loaded"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "append",
              "replace",
              "modify",
              "read",
              "load backup"
            ],
            "type": "string",
            "description": "What should the actor do",
            "default": "append"
          },
          "publicSpreadsheet": {
            "title": "Public spreadsheet (read-only)",
            "type": "boolean",
            "description": "If checked, you don't need to authorize. You have to publish your spreadsheet and it works only in read mode",
            "default": false
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Dataset or crawler execution id where the new data will be loaded from"
          },
          "rawData": {
            "title": "Raw data",
            "type": "array",
            "description": "Raw data JSON array. Can be array of arrays for direct row import or arrays of objects."
          },
          "limit": {
            "title": "Limit items",
            "minimum": 0,
            "type": "integer",
            "description": "Number of items to take from the dataset. The default is 250000.",
            "default": 250000
          },
          "offset": {
            "title": "Offset items",
            "minimum": 0,
            "type": "integer",
            "description": "Number of items to skip from the dataset. Default is 0.",
            "default": 0
          },
          "deduplicateByField": {
            "title": "Deduplicate by field",
            "type": "string",
            "description": "Items will be deduplicated by a value of this field. Cannot be used together with 'Deduplicate by equality' or 'Transform function'."
          },
          "deduplicateByEquality": {
            "title": "Deduplicate by equality",
            "type": "boolean",
            "description": "Items will be deduplicated if they are the same. Cannot be used together with 'Deduplicate by field' or 'Transform function'."
          },
          "transformFunction": {
            "title": "Transform function",
            "type": "string",
            "description": "Custom function that will take new items and old items arrays as parameters and produces final array that will be imported.  Cannot be used together with 'Deduplicate by equality' or 'Deduplicate by field'"
          },
          "range": {
            "title": "Range",
            "type": "string",
            "description": "Range of the spreadsheet in A1 notation where the actor should operate. Default is the first sheet."
          },
          "columnsOrder": {
            "title": "Columns order",
            "type": "array",
            "description": "Array of keys. First sorts the columns by provided keys. The rest is sorted alphabetically.",
            "items": {
              "type": "string"
            }
          },
          "keepSheetColumnOrder": {
            "title": "Keep column order from sheet",
            "type": "boolean",
            "description": "If true, keeps the order of columns as they are in the sheet. If there is no sheet data yet, this does nothing."
          },
          "tokensStore": {
            "title": "Google OAuth tokens store",
            "type": "string",
            "description": "Key-value store where your Google OAuth tokens will be stored so you don't have to authorize every time again. By default it is google-oauth-tokens",
            "default": "google-oauth-tokens"
          },
          "createBackup": {
            "title": "Create backup",
            "type": "boolean",
            "description": "Old rows from your spreadsheet will be saved to the default key-value store before importing new rows."
          },
          "backupStore": {
            "title": "Backup store id",
            "type": "string",
            "description": "Id of the key-value store where the backup you want to load is located. Can pnly be used if mode is 'load-backup'"
          },
          "googleCredentials": {
            "title": "Google Developer Console credentials",
            "type": "object",
            "description": "If you want to use this actor locally or with your own version, you have to provide your own crednetials. Check actor readme for more information."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}