{
  "openapi": "3.0.1",
  "info": {
    "title": "Datasheet Parser",
    "description": "Parse component datasheet PDFs (your uploads or manufacturer links) into normalized spec JSON — max ratings, electrical characteristics, pinout, ordering codes — with page-level citations and OCR.",
    "version": "0.1",
    "x-build-id": "gGWLVcmFp7r8jAnIL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leonyu~datasheet-parser/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leonyu-datasheet-parser",
        "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/leonyu~datasheet-parser/runs": {
      "post": {
        "operationId": "runs-sync-leonyu-datasheet-parser",
        "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/leonyu~datasheet-parser/run-sync": {
      "post": {
        "operationId": "run-sync-leonyu-datasheet-parser",
        "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": {
          "datasheetUrls": {
            "title": "Datasheet URLs",
            "type": "array",
            "description": "Direct http(s) links to PDF (or ZIP-of-PDF) files, typically the manufacturer's own file URL. Each entry is a URL string or an object with a url field. HTML catalog pages are not followed. Hosts such as AllDataSheet and Datasheet4U are rejected. st.com often times out and onsemi.com often returns HTTP 403 from cloud IPs. Upload those PDFs with Datasheet files instead of pasting the URL. Your own proxy URLs are optional; Apify Proxy is not used.",
            "items": {
              "type": "string"
            }
          },
          "datasheetFiles": {
            "title": "Datasheet files",
            "type": "array",
            "description": "Upload PDF, image, or ZIP files. The file picker stores each file in a key-value store and passes the record URL. You can also pass a record key from this run's default key-value store (for example \"nw3401n.pdf\") when the file was already uploaded there.",
            "items": {
              "type": "string"
            }
          },
          "maxFiles": {
            "title": "Max files",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of datasheets to parse after ZIP expansion. Extra files are skipped.",
            "default": 10
          },
          "maxPages": {
            "title": "Max pages per file",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Read at most this many pages of each PDF. The default is 120, which covers a typical datasheet such as the 68-page TI LM358 at the recommended 512 MB. A longer file is still returned as partial: pagesProcessed and pagesTotal are set, and the warnings explain that the rest was not read. The maximum is 200. Lower this for a fully scanned PDF so OCR can finish inside the 300 second run timeout.",
            "default": 120
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Reject a download or upload larger than this. ZIP members are checked individually, and the archive's total uncompressed size is also capped.",
            "default": 20
          },
          "ocrEnabled": {
            "title": "OCR scanned pages",
            "type": "boolean",
            "description": "Run Tesseract on pages that have almost no text layer. English traineddata is installed in the image. This is the main per-page cost.",
            "default": true
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "string",
            "description": "Tesseract language codes, for example eng or eng+deu. Traineddata must exist in the image. eng is installed; a missing language falls back to eng.",
            "default": "eng"
          },
          "includePageText": {
            "title": "Include full page text",
            "type": "boolean",
            "description": "Off by default. Datasheet prose is copyrighted. Leave this off unless you have the right to store the full text. Specs, pinout, and short provenance snippets are always returned.",
            "default": false
          },
          "partNumberHint": {
            "title": "Part number hint",
            "type": "string",
            "description": "Optional part number or ordering-code fragment. Matching codes are listed first. A hint that does not appear in the file is reported as a warning and does not replace extracted codes."
          },
          "componentCategoryHint": {
            "title": "Component category",
            "enum": [
              "auto",
              "IC",
              "op-amp",
              "MOSFET",
              "diode",
              "regulator",
              "capacitor",
              "resistor",
              "connector",
              "sensor",
              "MCU",
              "other"
            ],
            "type": "string",
            "description": "auto scores the first pages. Any other value is stored as the category and the guess is still reported as detectedCategory.",
            "default": "auto"
          },
          "normalizeUnits": {
            "title": "Normalize units to SI",
            "type": "boolean",
            "description": "Keep the original min/typ/max/unit and also write normalizedValue in SI (V, A, ohm, F, Hz, W, s, and K for temperature).",
            "default": true
          },
          "useLlm": {
            "title": "Fill empty identity fields with an LLM",
            "type": "boolean",
            "description": "Off by default. When on, only empty manufacturer, series, and description fields are sent, using the extracted fields rather than the full datasheet. You must supply your own API key. Nothing is sent if the key is missing.",
            "default": false
          },
          "llmApiKey": {
            "title": "LLM API key",
            "type": "string",
            "description": "Your key for the OpenAI-compatible endpoint. Stored as a secret input. It is not written to the dataset."
          },
          "llmBaseUrl": {
            "title": "LLM base URL",
            "type": "string",
            "description": "OpenAI-compatible base URL. The Actor calls POST {base}/chat/completions.",
            "default": "https://api.openai.com/v1"
          },
          "llmModel": {
            "title": "LLM model",
            "type": "string",
            "description": "Model name sent to the endpoint.",
            "default": "gpt-4o-mini"
          },
          "proxyConfiguration": {
            "title": "Custom proxy (optional)",
            "type": "object",
            "description": "Leave this empty unless a download should use your own proxy URLs. Apify Proxy is not available. If a manufacturer blocks the download, upload the PDF instead.",
            "properties": {
              "proxyUrls": {
                "title": "Your proxy URLs",
                "type": "array",
                "description": "HTTP proxy URLs you run yourself. Apify Proxy is not used.",
                "editor": "stringList",
                "items": {
                  "type": "string"
                }
              }
            },
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}