{
  "openapi": "3.0.1",
  "info": {
    "title": "ECHA REACH Lookup – SVHC, Annex XIV & XVII Status",
    "description": "REACH substance lookup on ECHA CHEM: CAS number, EC number or name in; registration status, SVHC candidate list inclusion with date and reason, Annex XIV and Annex XVII status and harmonised classification out. Monitor mode reports every Candidate List addition on the day.",
    "version": "0.1",
    "x-build-id": "3vZJ2aKXK5OtOxZdz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lwsdjfls~echa-reach-svhc-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lwsdjfls-echa-reach-svhc-lookup",
        "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/lwsdjfls~echa-reach-svhc-lookup/runs": {
      "post": {
        "operationId": "runs-sync-lwsdjfls-echa-reach-svhc-lookup",
        "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/lwsdjfls~echa-reach-svhc-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-lwsdjfls-echa-reach-svhc-lookup",
        "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": [
              "lookup",
              "monitor"
            ],
            "type": "string",
            "description": "Lookup: every substance is delivered on every run with its current status. Monitor: the run records a baseline and later runs deliver only what changed on the followed lists and watched substances (schedule it).",
            "default": "lookup"
          },
          "substances": {
            "title": "Substances",
            "maxItems": 10000,
            "type": "array",
            "description": "One per line: a CAS number (117-81-7), an EC number (204-211-0 or \"EC 204-211-0\") or a substance name (Bisphenol A). Numbers are check-digit validated; names must equal a name ECHA knows, otherwise the closest records are listed and nothing is charged. Lookups that find nothing are free, so they share an allowance of 1,000 requests per run, retries included, plus maxSearchPages per substance found: a lookup starts only while its search requests (one per CAS or EC number, up to maxSearchPages per name) still fit next to those of the lookups in progress, which can take a run past the allowance with their retries and, when they fail, the requests after their search. The substances that do not fit are logged as not looked up. CAS and EC numbers are looked up, and listed, before names.",
            "items": {
              "type": "string",
              "maxLength": 300
            },
            "default": []
          },
          "lists": {
            "title": "Lists to follow (monitor mode)",
            "maxItems": 3,
            "type": "array",
            "description": "Regulatory lists whose entries are followed in monitor mode. Every addition, change or removal is delivered as a change; the first run records the current list for free.",
            "items": {
              "type": "string",
              "enum": [
                "candidateList",
                "authorisationList",
                "restrictionList"
              ],
              "enumTitles": [
                "Candidate List of SVHCs",
                "Authorisation List (Annex XIV)",
                "Restriction List (Annex XVII)"
              ]
            },
            "default": [
              "candidateList"
            ]
          },
          "includeClassification": {
            "title": "Include harmonised classification",
            "type": "boolean",
            "description": "Adds the harmonised classification and labelling (CLP Annex VI): hazard classes, H-statements, signal word, pictograms and whether the substance is a category 1A/1B CMR.",
            "default": true
          },
          "includeRegistrations": {
            "title": "Include REACH registrations",
            "type": "boolean",
            "description": "Adds the REACH registration status: active and inactive dossiers, full versus intermediate registrations, joint submission, tonnage band and the latest dossier update.",
            "default": true
          },
          "maxSearchPages": {
            "title": "Search pages per name",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many pages of 100 search results are scanned for an exact name match. Common names sit deep in ECHA's ranking (\"Bisphenol A\" is on page 2).",
            "default": 3
          },
          "maxSubstancesPerRun": {
            "title": "Maximum substances per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Caps the charged lookups in one run. In lookup mode it also bounds the work: a run starts at most twice this many lookups (numbers ECHA does not know and names without an exact match are free but still take requests); the rest is not looked up and is logged.",
            "default": 1000
          },
          "maxChangesPerRun": {
            "title": "Maximum changes per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Monitor mode: caps the charged changes delivered in one run. When more changed at once, delivery stops at the cap and the rest is delivered by the next runs.",
            "default": 25
          },
          "maxConcurrency": {
            "title": "Parallel lookups",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Substances looked up at the same time. Requests to ECHA CHEM are paced at 4 per second regardless.",
            "default": 3
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Receives a POST with a summary after each run that delivered results or changes. Must be a public http(s) address; redirects are not followed. Stored encrypted, because webhook URLs often carry a token."
          },
          "stateKey": {
            "title": "State key",
            "pattern": "^[a-zA-Z0-9_-]{1,64}$",
            "type": "string",
            "description": "Separates independent monitors. Defaults to the task ID, so each saved task keeps its own baseline."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}