{
  "openapi": "3.0.1",
  "info": {
    "title": "Tianyancha Scraper - China Company Registry, Owners, Executives",
    "description": "China company lookup on Tianyancha (天眼查). No login, no API key. Paste company names, unified social credit codes, registration numbers or links, or search by keyword and province: registry profile, legal representative, status, capital, shareholders with percentages, executives, investments.",
    "version": "0.1",
    "x-build-id": "phhKXAQVg1TP4HxxZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hexagone-data~tianyancha-company-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hexagone-data-tianyancha-company-scraper",
        "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/hexagone-data~tianyancha-company-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hexagone-data-tianyancha-company-scraper",
        "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/hexagone-data~tianyancha-company-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hexagone-data-tianyancha-company-scraper",
        "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": {
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "One company per line: a Tianyancha link (https://www.tianyancha.com/company/24416401), an id (24416401), a unified social credit code (18 characters, 914403001922038216), a registration number (15 digits, 440301103097413) or the exact company name (贵州茅台酒股份有限公司). A name or a code is searched on Tianyancha and matched EXACTLY (full-width brackets count as normal ones, spaces ignored); no exact match = not_found, not charged. A Tianyancha search link (https://www.tianyancha.com/search?key=...) is read as a search, its region kept; a search link with another filter is refused, with its reason. Each company found gives one full profile row: one row event plus one company profile event (see Pricing).",
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Words searched on Tianyancha (咖啡, 物流, a brand, a city name). Without an account Tianyancha shows only the first 20 companies of a search: add regions or split by province to get more. Each result is one search row (one row event), or one full profile if Open search results is on.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions (searches only)",
            "type": "array",
            "description": "Each search keyword is searched once per region. Province codes of Tianyancha: bj, tj, heb, sx, nmg, ln, jl, hlj, sh, js, zj, ah, fj, jx, sd, hen, hub, hun, gd, gx, han, cq, sc, gz, yn, xz, snx, gs, qh, nx, xj, hk, tw, mo; or a 6-digit Chinese administrative code: province 440000, city 440300 (Shenzhen), district 440305 (Nanshan). The filter is checked on the page Tianyancha serves: a code the site does not apply gives region_not_recognized, no row delivered or charged for this search. Empty = the whole country.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "splitByProvince": {
            "title": "Split each search by province",
            "type": "boolean",
            "description": "When Regions is empty: search each keyword in each of the 34 regions above (34 searches per keyword, up to 20 companies each). A company found in two regions is delivered and charged once.",
            "default": false
          },
          "openSearchResults": {
            "title": "Open search results (full profiles)",
            "type": "boolean",
            "description": "Off: one search row per result, from the search card (one row event). On: the company page of each result is read and delivered as a full profile row (one row event plus one company profile event), with the sections you choose below.",
            "default": false
          },
          "includeShareholders": {
            "title": "Include shareholders",
            "type": "boolean",
            "description": "For each profile row: the shareholders with percentage, type and labels (beneficial owner, actual controller). Adds one Shareholders section event per company that has at least one shareholder; an empty or failed section is not charged.",
            "default": false
          },
          "includeExecutives": {
            "title": "Include executives",
            "type": "boolean",
            "description": "For each profile row: executives with positions (up to 100: Tianyancha shows more only after login). Adds one Executives section event per company that has at least one executive; an empty or failed section is not charged.",
            "default": false
          },
          "includeInvestments": {
            "title": "Include investments",
            "type": "boolean",
            "description": "For each profile row: the companies it invested in, with percentage and status. Adds one Investments section event per company that has at least one investment; an empty or failed section is not charged.",
            "default": false
          },
          "acceptClosestMatch": {
            "title": "Accept the closest match",
            "type": "boolean",
            "description": "For a name or code without an exact match: take Tianyancha's first result (matchType closest) instead of not_found. Off by default: the first result is often another company with a similar name.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows in total",
            "minimum": 0,
            "type": "integer",
            "description": "Rows delivered at most in this run, all inputs and searches together. 0 = no limit. Rows not delivered are not charged.",
            "default": 10
          },
          "maxResultsPerSearch": {
            "title": "Max rows per search",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Rows delivered at most for each search (keyword x region), 1 to 20: Tianyancha shows 20 companies per search without an account.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Tianyancha only serves visitors in mainland China (HTTP 419 elsewhere, including Hong Kong and Taiwan): keep the RESIDENTIAL proxy group with country CN. Its cost is included in the price. Another setting is used as given, and a refusal is reported as such, never as an empty search.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "CN"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}