{
  "openapi": "3.0.1",
  "info": {
    "title": "China Statistics Database API: NBS GDP, CPI & Province Data",
    "description": "Any of 3,300+ tables from China's National Bureau of Statistics database (国家数据), in Chinese and English: GDP, prices, industry, trade, investment, population and more, national, by province and for 36 cities. Monthly, quarterly and annual history. No login.",
    "version": "1.0",
    "x-build-id": "I2i33YdGmsjx2hRug"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sinodata~china-statistics-database/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sinodata-china-statistics-database",
        "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/sinodata~china-statistics-database/runs": {
      "post": {
        "operationId": "runs-sync-sinodata-china-statistics-database",
        "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/sinodata~china-statistics-database/run-sync": {
      "post": {
        "operationId": "run-sync-sinodata-china-statistics-database",
        "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": {
          "tables": {
            "title": "Tables",
            "type": "array",
            "description": "Table names in Chinese or English (e.g. 国内生产总值 (现价), Gross Domestic Product, 居民消费价格指数), or table IDs. A name can match several tables; turn on List tables to browse the catalog first.",
            "default": [
              "国内生产总值 (现价)"
            ],
            "items": {
              "type": "string"
            }
          },
          "sections": {
            "title": "Sections",
            "type": "array",
            "description": "Which parts of the database to search: national, by province or for major cities, monthly, quarterly or annual.",
            "items": {
              "type": "string",
              "enum": [
                "monthly",
                "quarterly",
                "annual",
                "provinceMonthly",
                "provinceQuarterly",
                "provinceAnnual",
                "cityMonthly",
                "cityAnnual"
              ],
              "enumTitles": [
                "National, monthly",
                "National, quarterly",
                "National, annual",
                "By province, monthly",
                "By province, quarterly",
                "By province, annual",
                "Major cities, monthly",
                "Major cities, annual"
              ]
            },
            "default": [
              "monthly",
              "quarterly",
              "annual"
            ]
          },
          "indicators": {
            "title": "Indicators",
            "type": "array",
            "description": "Optional: only indicators whose name contains one of these words (Chinese or English). Leave empty for every indicator in the table.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Provinces or cities",
            "type": "array",
            "description": "For province and city sections: names in Chinese or English (e.g. 广东, Beijing). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "latestPeriods": {
            "title": "Latest periods",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "How many of the most recent months, quarters or years to get. Ignored when you set a period range.",
            "default": 8
          },
          "periodFrom": {
            "title": "History from",
            "type": "string",
            "description": "Start of a period range: 2015 for years, 2020-01 for months, 2020-Q1 for quarters. A bare year works for every frequency."
          },
          "periodTo": {
            "title": "History to",
            "type": "string",
            "description": "End of the range, in the same format. Leave empty for up to the latest data."
          },
          "maxTables": {
            "title": "Max tables",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Upper limit on tables per run when your names match many tables.",
            "default": 10
          },
          "listTables": {
            "title": "List tables",
            "type": "boolean",
            "description": "Only list the tables (ID, section, Chinese and English path) whose name matches Tables, or every table in the chosen sections if Tables is empty. Free.",
            "default": false
          },
          "skipUnchanged": {
            "title": "Only new data",
            "type": "boolean",
            "description": "For scheduled runs: skip (and don't pay for) values you already saved in a previous run.",
            "default": false
          },
          "refreshCatalog": {
            "title": "Refresh the table catalog",
            "type": "boolean",
            "description": "Read the table list live from the site instead of the built-in copy (adds a few minutes). Only needed if a new table is missing.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}