{
  "openapi": "3.0.1",
  "info": {
    "title": "AImart Parquet: messy files to Parquet + SQL",
    "description": "AImart Parquet turns messy data files into clean, typed Parquet and, if you ask, answers a read-only SQL query over each file. Give it links to CSV, Excel, SPSS, Stata, SAS or JSON files, or tables in digital PDFs; get back one Parquet file per input.",
    "version": "0.0",
    "x-build-id": "mGq8vhqLviMrlJCX0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kingofthejunes~aimart-parquet/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kingofthejunes-aimart-parquet",
        "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/kingofthejunes~aimart-parquet/runs": {
      "post": {
        "operationId": "runs-sync-kingofthejunes-aimart-parquet",
        "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/kingofthejunes~aimart-parquet/run-sync": {
      "post": {
        "operationId": "run-sync-kingofthejunes-aimart-parquet",
        "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": {
          "urls": {
            "title": "File links",
            "maxItems": 20,
            "type": "array",
            "description": "Public http(s) links to the files to convert, one per entry (up to 20). Formats: CSV/TSV, JSON/NDJSON, Excel (xlsx, xls, ods), SPSS (sav, zsav, por), Stata (dta), SAS (sas7bdat, xpt), Parquet and tables in digital (not scanned) PDFs, optionally gzip, bz2 or zip compressed; the format is detected from the bytes. Each file may be up to 50 MB. Links must be reachable without signing in (a pre-signed S3 or Google Cloud Storage link works); private and local network addresses are refused.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            }
          },
          "files": {
            "title": "Inline files (base64)",
            "maxItems": 10,
            "type": "array",
            "description": "Files sent inline instead of by link, for small files (a few MB): each entry is {\"fileName\": \"data.csv\", \"contentBase64\": \"<the file's bytes in base64>\"}. fileName is optional; it names the output and helps detection when the bytes are ambiguous. Up to 10 entries.",
            "items": {
              "type": "object",
              "properties": {
                "fileName": {
                  "title": "File name",
                  "type": "string",
                  "description": "The original file name, e.g. survey.sav.",
                  "maxLength": 255
                },
                "contentBase64": {
                  "title": "Content (base64)",
                  "type": "string",
                  "description": "The file's bytes, base64-encoded (standard or URL-safe alphabet; a data: URL prefix is accepted).",
                  "minLength": 1
                }
              },
              "required": [
                "contentBase64"
              ],
              "additionalProperties": false
            }
          },
          "options": {
            "title": "Conversion options",
            "type": "object",
            "description": "Optional, applied to every file; leave {} to auto-detect everything. Keys: format (force csv, tsv, json, ndjson, xlsx, xls, ods, sav, zsav, por, dta, sas7bdat, xpt, parquet or pdf), sheet (Excel sheet name or 0-based index), delimiter (one character), header (true/false), encoding (e.g. cp1252, latin-1), null_values (extra null tokens), date_order (auto, dmy, mdy or ymd), infer_types (false keeps text), normalize_column_names, json_records_path (e.g. data.items), flatten_nested, value_labels (metadata, apply or both), pdf_pages (e.g. 1-3,7), pdf_table, sort_by (columns), expected_schema with strict, compression (zstd, snappy, gzip or none), row_group_size. An unknown key or invalid value fails every file, unpaid.",
            "default": {}
          },
          "sql": {
            "title": "SQL query (optional)",
            "maxLength": 20000,
            "type": "string",
            "description": "One read-only DuckDB SELECT run over each converted file, which is the table data, e.g. SELECT region, sum(units * unit_price) AS revenue FROM data GROUP BY region ORDER BY revenue DESC. CTEs, DESCRIBE and SUMMARIZE work; anything that writes is refused. Leave empty to only convert. Charged once per file it runs on; a failed query is not charged (the conversion still is)."
          },
          "queryLimit": {
            "title": "Query row limit",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "The most rows the query returns per file (1 to 1000). The item's query.truncated is true when more rows matched.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}