{
  "openapi": "3.0.1",
  "info": {
    "title": "Tianyancha Company Scraper 天眼查: China Company Owners & Status",
    "description": "Turn a Chinese company name, credit code, link or Tianyancha 天眼查 gid into one complete record: owners, shareholders, beneficial owners, legal representative, capital, status, investments and executives. One run, whole company. No login or API key. 天眼查企业信息查询。",
    "version": "0.2",
    "x-build-id": "LaRGUNdYcx9sFB61y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/getascraper~tianyancha-company-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-getascraper-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/getascraper~tianyancha-company-scraper/runs": {
      "post": {
        "operationId": "runs-sync-getascraper-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/getascraper~tianyancha-company-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-getascraper-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": "Companies to look up, one per row. Mix freely: company name, unified social credit code (18 characters), registration number (15 digits), a tianyancha.com company link, or the numeric company id. Names and codes are matched exactly against the site search; if nothing matches, the row says so instead of guessing. No internal id is needed.",
            "default": [
              "贵州茅台酒股份有限公司"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Optional discovery searches such as a brand, trade or place (for example 白酒 or 新能源 深圳). Each keyword returns the site's first 20 matches as rows with registry basics. The site does not page or filter further, so use the province split below to reach more.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "splitByProvince": {
            "title": "Split each keyword by province",
            "type": "boolean",
            "description": "Runs every keyword once per province (keyword plus province name) and merges the results without duplicates, to get past the 20 results a single search returns. Uses one search request per province, so keep Maximum companies in mind.",
            "default": false
          },
          "provinces": {
            "title": "Provinces to split by",
            "type": "array",
            "description": "Only used when the province split is on. Chinese or English province names, for example Sichuan or 四川. Leave empty to use all 31 mainland provinces, municipalities and regions.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "splitByCity": {
            "title": "Split each keyword by city",
            "type": "boolean",
            "description": "Runs every keyword once per city (keyword plus city name) and merges the results without duplicates, to reach far beyond the 20 results one search returns. Leave the city list empty to use about 330 mainland cities, prefectures and municipalities. One search request per city, so keep Maximum companies in mind; a full city run for one keyword takes roughly ten minutes.",
            "default": false
          },
          "cities": {
            "title": "Cities to split by",
            "type": "array",
            "description": "Only used when the city split is on. Chinese city names, for example 深圳 or 遵义. County-level cities such as 昆山 also work. Leave empty to use the built-in list of mainland cities.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "enrichSearchResults": {
            "title": "Open every discovery result for the full profile",
            "type": "boolean",
            "description": "Off: keyword results are search-level rows (registry basics, address, emails). On: each result's company page is opened too, adding staff, tax, listing, financial figures, section counts and any sections chosen below. Each opened company is billed as a company profile and costs about one extra page.",
            "default": false
          },
          "includeShareholders": {
            "title": "Shareholders",
            "type": "boolean",
            "description": "Paid add-on, charged per row where it returns data. Adds the shareholder list with ownership percent as a number, share type, holder type and flags for controlling shareholder, largest shareholder, actual controller and beneficial owner. One extra page per company.",
            "default": false
          },
          "includeInvestments": {
            "title": "Outbound investments",
            "type": "boolean",
            "description": "Paid add-on, charged per row where it returns data. Adds the companies this company invests in, with stake percent, invested capital, status, location and industry. One extra page per company.",
            "default": false
          },
          "includeExecutives": {
            "title": "Executives and directors",
            "type": "boolean",
            "description": "Paid add-on, charged per row where it returns data. Adds key people with position, term dates, education and a flag for the legal representative. Names are personal data: use them only for a lawful purpose. One extra page per company.",
            "default": false
          },
          "ownershipLevels": {
            "title": "Ownership chain: levels to follow",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Paid add-on. Follows corporate shareholders upward to find who ultimately owns each company, with each owner's effective share of the company and the path to them, plus a list of the owners holding 25% or more (beneficial owners). 0 is off. 2 means the shareholders and their own shareholders, up to 5. Turns Shareholders on. Charged for every extra company read, so start with 2 or 3. The row says whether the chain is complete or stopped at a limit. Available for runs started from 12 November 2026, 05:00 UTC. Earlier runs return the rows without the chain and are not charged for it.",
            "default": 0
          },
          "ownershipMaxCompanies": {
            "title": "Ownership chain: most companies to read per company",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Safety limit for the ownership chain. Large holding groups can have hundreds of owners, so the chain stops after this many extra companies and marks itself incomplete. Only used when ownership levels is 2 or more.",
            "default": 20
          },
          "includeRiskSummary": {
            "title": "Risk summary (counts only)",
            "type": "boolean",
            "description": "Adds a plain summary of how many lawsuits, hearing notices, penalties, dishonest-debtor and abnormal-operation records the site lists, plus its own-risk, related-party, historical and warning totals. Counts only, never the underlying records. Uses data already on the company page, so no extra request.",
            "default": false
          },
          "monitorScope": {
            "title": "Monitor name",
            "type": "string",
            "description": "Give a name to track these companies over time. Each run then marks every row NEW, UPDATED, UNCHANGED, CLOSED or REOPENED and lists changedFields for status, legal representative, registered capital, address, name, business scope and (when fetched) shareholders. A company is CLOSED only when the registry shows it cancelled or its page is confirmed gone. Use the same name on every scheduled run. Leave empty for a one-off run.",
            "default": ""
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "all",
              "changesOnly"
            ],
            "type": "string",
            "description": "All rows, or only rows that are new, changed, closed or reopened since the last run. Only has an effect when a monitor name is set.",
            "default": "all"
          },
          "notificationWebhookUrl": {
            "title": "Change webhook URL",
            "type": "string",
            "description": "Optional. An HTTPS address that receives a short JSON summary after each complete monitor run: counts of new, updated, closed and reopened companies and up to 25 of the changed companies with their changed fields. Only used together with a monitor name. Leave empty to turn it off. Delivery is best effort and never changes the rows or the saved monitor state."
          },
          "notificationEvents": {
            "title": "Changes that trigger the webhook",
            "maxItems": 4,
            "uniqueItems": true,
            "type": "array",
            "description": "Which changes send the webhook. A run with none of these changes sends nothing, unless the heartbeat below is on.",
            "items": {
              "type": "string",
              "enum": [
                "NEW",
                "UPDATED",
                "CLOSED",
                "REOPENED"
              ],
              "enumTitles": [
                "New companies",
                "Updated companies",
                "Closed companies",
                "Reopened companies"
              ]
            },
            "default": [
              "NEW",
              "UPDATED",
              "CLOSED",
              "REOPENED"
            ]
          },
          "notifyOnNoChanges": {
            "title": "Send a heartbeat when nothing changed",
            "type": "boolean",
            "description": "Also send the webhook after a complete monitor run that found none of the selected changes, so you know the watch list was checked.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum companies",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper limit on companies processed in this run, across company lookups and keyword results. Start small: each company costs one to four page reads through a mainland China residential connection.",
            "default": 10
          },
          "includePinyin": {
            "title": "Add pinyin reading of names",
            "type": "boolean",
            "description": "Adds namePinyin and legalRepresentativePinyin next to the Chinese text, so names can be read, searched and pasted without Chinese. The Chinese is never replaced. A reading is added only when it is certain: names with characters whose reading depends on context get none rather than a wrong one. Addresses are not romanised.",
            "default": true
          },
          "includeStatusRows": {
            "title": "Add a row for inputs that could not be resolved",
            "type": "boolean",
            "description": "When on, an input with no match, a missing page or a failed read gets a row with lookupStatus and a short message so nothing silently disappears. Turn off to receive data rows only; unresolved inputs are still listed in the run summary.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The source only serves visitors from mainland China, so the default is Apify Residential proxy with country China (CN). Keep it unless you supply your own mainland China proxy. Other countries are refused by the source and the run ends with a clear message.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}