{
  "openapi": "3.0.1",
  "info": {
    "title": "Korea Food Import Records, Importers & Rejections",
    "description": "Find who imports your product into Korea: official MFDS import declarations (product, Korean importer, manufacturer, origin), importer lead lists, border inspection rejections with reasons, and yearly import statistics, in English.",
    "version": "0.1",
    "x-build-id": "m9hocZgHa0hTmcoLI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cm504~korea-food-imports/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cm504-korea-food-imports",
        "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/cm504~korea-food-imports/runs": {
      "post": {
        "operationId": "runs-sync-cm504-korea-food-imports",
        "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/cm504~korea-food-imports/run-sync": {
      "post": {
        "operationId": "run-sync-cm504-korea-food-imports",
        "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": {
          "mode": {
            "title": "What to do",
            "enum": [
              "find_importers",
              "shipments",
              "rejections",
              "item_stats"
            ],
            "type": "string",
            "description": "Choose the task. find_importers = ranked lead list of Korean importers of a product, grouped from recent MFDS import declarations. shipments = individual import declarations (product, importer, manufacturer, origin, dates), newest first. rejections = imported foods that failed Korean border inspection, with the reason in English (default). item_stats = yearly import quantity, weight and value per MFDS food item.",
            "default": "rejections"
          },
          "productEn": {
            "title": "Product name (English)",
            "type": "string",
            "description": "Text contained in the declared English product name (plain substring, case-insensitive), e.g. OLIVE OIL, KIMCHI, PROTEIN BAR, COFFEE, FROZEN. Used by find_importers, shipments and rejections. Be specific: WINE also matches SWINE. Leave empty to search by importer or dates only.",
            "default": ""
          },
          "productKo": {
            "title": "Product or item name (Korean)",
            "type": "string",
            "description": "Korean text instead of English, e.g. 김치 (kimchi), 올리브유 (olive oil), 커피 (coffee), 와인 (wine). For item_stats this is the Korean MFDS food item name (partial match, e.g. 커피 returns roasted coffee, instant coffee...). For declarations it filters the Korean product name; combined with the English name both must match.",
            "default": ""
          },
          "importer": {
            "title": "Importer (Korean name contains)",
            "type": "string",
            "description": "Only declarations by importers whose Korean company name contains this text, e.g. 코스트코 (Costco Korea), 이마트 (E-mart), 롯데 (Lotte). Korean only, because importers are registered in Korean. Used by find_importers and shipments.",
            "default": ""
          },
          "since": {
            "title": "Accepted on or after",
            "type": "string",
            "description": "YYYY-MM-DD. Only declarations accepted (or rejections dated) on or after this day. For shipments and find_importers a date range alone is a valid search (without until: up to today)."
          },
          "until": {
            "title": "Accepted on or before",
            "type": "string",
            "description": "YYYY-MM-DD. Only declarations accepted (or rejections dated) on or before this day. Default: today (Korea time). When you set until, set since as well."
          },
          "year": {
            "title": "Statistics year",
            "minimum": 2015,
            "type": "integer",
            "description": "For item_stats only: one statistics year, e.g. 2025. Leave empty for all years (newest first)."
          },
          "maxShipmentsToScan": {
            "title": "Declarations to scan (importer search)",
            "minimum": 100,
            "maximum": 50000,
            "type": "integer",
            "description": "find_importers only: how many of the most recent matching declarations to group into importers (100-50,000). Popular products have tens of thousands of declarations; 5,000 covers recent months, 1,000 is faster.",
            "default": 5000
          },
          "onlyNew": {
            "title": "Only items not delivered before",
            "type": "boolean",
            "description": "For scheduled monitoring: skip records already returned by a previous run with the same monitor name (by receipt number; for find_importers, by importer). Example: schedule rejections daily with onlyNew to get only new border rejections.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Keeps separate 'only new' memories for different schedules, e.g. rejections-daily or olive-oil-importers. Letters, digits and dashes.",
            "default": "default"
          },
          "translateToEnglish": {
            "title": "English importer names, item names and rejection reasons",
            "type": "boolean",
            "description": "Translate importer names, item types and rejection reasons into English with Claude (Anthropic). Korean originals are always included. Turn off for Korean only.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many results (records you pay for). Default 50.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}