{
  "openapi": "3.0.1",
  "info": {
    "title": "EU Import Data API",
    "description": "Unofficial EU import data API: monthly EU trade statistics. Reads Eurostat Comext and returns import or export value in euros, weight, supplementary units and unit values by product code, EU reporter country and partner country.",
    "version": "0.1",
    "x-build-id": "LQMXIrVZkbQqTghYb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sourcing-data-studio~eu-import-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sourcing-data-studio-eu-import-data-api",
        "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/sourcing-data-studio~eu-import-data-api/runs": {
      "post": {
        "operationId": "runs-sync-sourcing-data-studio-eu-import-data-api",
        "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/sourcing-data-studio~eu-import-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-sourcing-data-studio-eu-import-data-api",
        "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",
        "required": [
          "productCodes"
        ],
        "properties": {
          "productCodes": {
            "title": "Product codes",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "description": "Required. The goods to look up, as text codes with 2, 4, 6 or 8 digits (HS2, HS4, HS6 or the EU's 8-digit CN8 code). Examples: \"85171300\" for smartphones, \"8517\" for telephone sets and other apparatus, \"85\" for all electrical machinery. Write codes in quotes so leading zeros stay. Dots and spaces are ignored, so 8517.13.00 works. At least one request is made per code, so use at most 50 codes. 8-digit codes cannot be combined with reporter AT (Austria), because Eurostat does not allow resale of Austria's 8-digit data. Codes that Eurostat does not list are reported in the run summary and never charged.",
            "items": {
              "type": "string"
            }
          },
          "reporters": {
            "title": "Reporting countries",
            "maxItems": 27,
            "type": "array",
            "description": "The EU member states whose customs declarations you want, as 2-letter codes: AT, BE, BG, CY, CZ, DE, DK, EE, ES, FI, FR, GR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI or SK. Greece is GR; EL is also accepted. The default is DE, FR, NL, IT and ES. Each reporter gives one record per month: its trade with each partner. Switzerland (CH) and Liechtenstein (LI) cannot be reporters, because Eurostat does not allow resale of their data. Austria (AT) cannot be used with 8-digit product codes for the same reason.",
            "default": [
              "DE",
              "FR",
              "NL",
              "IT",
              "ES"
            ],
            "items": {
              "type": "string"
            }
          },
          "partners": {
            "title": "Partner countries",
            "maxItems": 50,
            "type": "array",
            "description": "The countries the goods come from (for imports) or go to (for exports), as 2-letter ISO codes such as CN (China), US, GB (United Kingdom; UK is also accepted), VN, TR or IN. Also accepted: WORLD (all countries), EXT_EU27_2020 (all countries outside the EU) and INT_EU27_2020 (the other EU member states). The default is CN. Use at most 50 partners. A code that Eurostat does not list gives no records and a warning in the run summary.",
            "default": [
              "CN"
            ],
            "items": {
              "type": "string"
            }
          },
          "flow": {
            "title": "Trade flow",
            "enum": [
              "import",
              "export"
            ],
            "type": "string",
            "description": "import: goods the reporting country buys from the partner. export: goods it sells to the partner. The default is import.",
            "default": "import"
          },
          "periodFrom": {
            "title": "First month",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
            "type": "string",
            "description": "First month to include, written YYYY-MM, for example 2025-01. The earliest month is 1988-01. If you leave it empty, the run looks at the 12 months up to the last month and gives you the newest 3 months that have data for each reporter, partner and product. Eurostat publishes with a delay of about two months, so the newest months may be missing."
          },
          "periodTo": {
            "title": "Last month",
            "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
            "type": "string",
            "description": "Last month to include, written YYYY-MM, for example 2025-03. If empty, the run goes up to the current month. A month in the future means the current month. If you give only the last month, you get the newest 3 months with data in the 12 months up to it. The run covers at most 100,000 combinations of product code, reporter, partner and month."
          },
          "maxItems": {
            "title": "Maximum trade records",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of monthly trade records to save and pay for in this run, across all product codes, countries and months. One record is one reporter, partner, product code and month. The run stops as soon as this many records are saved. If your request covers more records, the run log warns you at the start, the newest months of each reporter and partner are saved first, and the run summary says truncated. The default is 100.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The Eurostat API is public and answers direct requests, so no proxy is used by default. Use a proxy only if your network needs one. The Actor sends all requests of a run from one address and never uses another address to get around a refusal (HTTP 401, 403, 407 or 429).",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxRequestRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "How many times a failed request is retried, with a growing pause between tries. A refusal (HTTP 401, 403 or 407) is never retried. After HTTP 429 the Actor waits as long as Eurostat asks, up to 60 seconds, and asks again from the same address. Failed requests are never charged. The run stops early when 5 requests in a row fail.",
            "default": 3
          },
          "debugLog": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Print detailed debug messages to the run log.",
            "default": false
          },
          "feedback": {
            "title": "Feedback for the developer",
            "maxLength": 1000,
            "type": "string",
            "description": "Optional. Tell us which product codes, countries or fields you need next, or what went wrong. It is saved with the run summary. Do not include personal data. AI agents may also use this field to report problems."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}