{
  "openapi": "3.0.1",
  "info": {
    "title": "LEI Lookup & Corporate Ownership Tree, from GLEIF data",
    "description": "Look up companies by LEI or name in GLEIF's open Global LEI Index: legal data, direct and ultimate parent, subsidiary counts, the full control tree and ISINs, in one item.",
    "version": "0.1",
    "x-build-id": "6iNRj02UNbHsbrs2F"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/br_data_hub~lei-corporate-tree/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-br_data_hub-lei-corporate-tree",
        "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/br_data_hub~lei-corporate-tree/runs": {
      "post": {
        "operationId": "runs-sync-br_data_hub-lei-corporate-tree",
        "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/br_data_hub~lei-corporate-tree/run-sync": {
      "post": {
        "operationId": "run-sync-br_data_hub-lei-corporate-tree",
        "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": {
          "leis": {
            "title": "LEI codes",
            "type": "array",
            "description": "Enter Legal Entity Identifiers (20 characters), one per line, e.g. HWUPKR0MPOU8FGXBT394. Check digits are validated before any lookup. Up to 200 LEIs and names per run.",
            "default": [
              "HWUPKR0MPOU8FGXBT394"
            ],
            "items": {
              "type": "string"
            }
          },
          "names": {
            "title": "Company names",
            "type": "array",
            "description": "Enter company names to search in GLEIF, one per line, e.g. Siemens. Results are ranked by name similarity; case, accents and legal forms such as Inc, GmbH or S.A. are ignored.",
            "default": [
              "Siemens"
            ],
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country for names",
            "type": "string",
            "description": "Type an ISO two-letter country code of the legal address, e.g. BR, US or DE. Applies to the name search only.",
            "default": "DE"
          },
          "matchesPerName": {
            "title": "Matches per name",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Set how many best-ranked entities to return for each name, e.g. 1. Each is a charged result; the next candidates come free in the alternatives field.",
            "default": 1
          },
          "minMatchPercent": {
            "title": "Min match score (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Set the name similarity (0 to 100) a candidate needs, e.g. 60 (100 = same name after normalization). Below it you get a free error item instead.",
            "default": 60
          },
          "maxDepth": {
            "title": "Tree depth",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Set how many levels of subsidiaries to expand in the control tree, e.g. 2. Use 0 to turn the tree off.",
            "default": 2
          },
          "maxNodes": {
            "title": "Max tree nodes",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Set the maximum entities in each control tree, e.g. 30. Large groups have thousands of subsidiaries; when the limit is hit, treeTruncated is true. Tree nodes are never charged.",
            "default": 30
          },
          "treeFrom": {
            "title": "Build tree from",
            "enum": [
              "entity",
              "ultimateParent"
            ],
            "type": "string",
            "description": "Pick 'The entity' to start the tree at the entity itself (its subsidiaries) or 'Its ultimate parent' to show the whole group.",
            "default": "entity"
          },
          "includeParentChain": {
            "title": "Include parent chain",
            "type": "boolean",
            "description": "Keep on to list every direct parent from the entity up to the top of the group (one extra request per level).",
            "default": true
          },
          "maxIsins": {
            "title": "Max ISINs per entity",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Set how many ISIN codes mapped to the LEI by GLEIF to return, e.g. 20. The total count is always returned; 0 skips ISINs.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}