{
  "openapi": "3.0.1",
  "info": {
    "title": "Tianyancha Company Scraper 天眼查: China Company Owners & Status",
    "description": "Look up Chinese companies on Tianyancha 天眼查 by name, credit code, link or keyword. Get one merged row each: legal representative, capital, status, emails, plus optional shareholders, investments and executives. Exact matching, watch lists for changes, no login or API key. 天眼查企业信息查询。",
    "version": "0.1",
    "x-build-id": "PwAjYl791PEv8C4Li"
  },
  "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"
            }
          },
          "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
          },
          "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"
          },
          "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
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}