{
  "openapi": "3.0.1",
  "info": {
    "title": "EUDR Due-Diligence Package Builder: GeoJSON + Deforestation PDF",
    "description": "Turn a supplier CSV, KML or GeoJSON into an EUDR filing package: geometry repaired to the EU Information System rules, each plot screened against the JRC 2020 forest map and post-2020 tree-cover loss, an evidence PDF per plot, a clean GeoJSON and a DDS draft for the TRACES Operator API.",
    "version": "0.1",
    "x-build-id": "djAwOKo0cgvBw4rmL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/latentlark~eudr-due-diligence-package-builder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-latentlark-eudr-due-diligence-package-builder",
        "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/latentlark~eudr-due-diligence-package-builder/runs": {
      "post": {
        "operationId": "runs-sync-latentlark-eudr-due-diligence-package-builder",
        "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/latentlark~eudr-due-diligence-package-builder/run-sync": {
      "post": {
        "operationId": "run-sync-latentlark-eudr-due-diligence-package-builder",
        "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": {
          "plotFile": {
            "title": "Supplier plot file",
            "type": "string",
            "description": "Upload a CSV, KML, KMZ or GeoJSON file from your supplier (or paste a direct download link). CSV needs latitude + longitude columns (one row per point, or several rows with the same plot ID for a polygon) or a WKT column. Comma or semicolon separated; decimal commas are fine."
          },
          "plotFileUrls": {
            "title": "More file links",
            "type": "array",
            "description": "Optional extra direct download links (CSV, KML/KMZ, GeoJSON). All files are merged into one package.",
            "items": {
              "type": "string"
            }
          },
          "plotsText": {
            "title": "Paste plots (CSV, KML or GeoJSON text)",
            "type": "string",
            "description": "Optional: paste the file content instead of uploading. Handy from n8n, Make or Zapier."
          },
          "geojson": {
            "title": "GeoJSON plots (JSON)",
            "type": "object",
            "description": "Optional: a GeoJSON FeatureCollection, Feature or geometry. The prefilled demo is one 81 ha cattle plot in Rondonia (Brazil) with an open ring and supplier-style column names, so you can see the repairs, the screening and the PDF for one plot."
          },
          "commodity": {
            "title": "Commodity",
            "enum": [
              "cattle",
              "cocoa",
              "coffee",
              "oil_palm",
              "rubber",
              "soya",
              "wood"
            ],
            "type": "string",
            "description": "Relevant commodity. Cattle allows point plots over 4 ha. Also used to suggest an HS heading if you leave it empty."
          },
          "defaultCountry": {
            "title": "Default country of production",
            "type": "string",
            "description": "ISO 2-letter code (e.g. GH, CI, BR) or country name, used for plots without a country."
          },
          "defaultProducerName": {
            "title": "Default producer name",
            "type": "string",
            "description": "Used for plots without a producer name."
          },
          "activityType": {
            "title": "Activity type",
            "enum": [
              "IMPORT",
              "EXPORT",
              "DOMESTIC"
            ],
            "type": "string",
            "description": "DDS statement.activityType. Leave empty to fill it yourself."
          },
          "operatorRole": {
            "title": "Operator role",
            "enum": [
              "OPERATOR",
              "REPRESENTATIVE_OPERATOR"
            ],
            "type": "string",
            "description": "DDS operatorRole."
          },
          "hsHeading": {
            "title": "HS heading",
            "pattern": "^[0-9]{2,10}$",
            "type": "string",
            "description": "2-10 digit HS code. Empty = a default suggested from the commodity, flagged for you to confirm."
          },
          "descriptionOfGoods": {
            "title": "Description of goods",
            "maxLength": 150,
            "type": "string",
            "description": "DDS descriptionOfGoods (max 150 characters)."
          },
          "netWeightKg": {
            "title": "Net weight (kg)",
            "minimum": 0,
            "type": "number",
            "description": "Mandatory in the DDS for IMPORT and EXPORT."
          },
          "countryOfActivity": {
            "title": "EU country of activity",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "ISO 2-letter code of the EU Member State."
          },
          "borderCrossCountry": {
            "title": "Border-crossing country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Country of entry (import) or exit (export)."
          },
          "internalReference": {
            "title": "Your internal reference",
            "maxLength": 46,
            "type": "string",
            "description": "Optional internalReferenceNumber for the DDS draft."
          },
          "geoLocationConfidential": {
            "title": "Geolocation confidential",
            "type": "boolean",
            "description": "DDS geoLocationConfidential. Leave unset to decide later (it is listed in operatorMustFill)."
          },
          "runScreening": {
            "title": "Screen for deforestation",
            "type": "boolean",
            "description": "Check every plot against the JRC Global Forest Cover 2020 map and Hansen tree-cover loss 2021-2025. Free public data, no API key.",
            "default": true
          },
          "highRiskMinHa": {
            "title": "High risk if forest-2020 lost after 2020 is at least (ha)",
            "minimum": 0,
            "type": "number",
            "description": "Absolute threshold. Any smaller amount still gives \"needs review\".",
            "default": 0.5
          },
          "highRiskPct": {
            "title": "...or at least this % of the plot",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Relative threshold for high risk.",
            "default": 2
          },
          "reviewForestPct": {
            "title": "Needs review if forest in 2020 covers at least (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Plots that were largely forest in 2020 deserve a closer look even without detected loss (agroforestry and tree crops can map as forest).",
            "default": 10
          },
          "generatePdf": {
            "title": "Evidence PDF per plot",
            "type": "boolean",
            "description": "Write one evidence PDF per plot (map thumbnail, forest and loss numbers, fixes, sources). Turn off for a faster, smaller run.",
            "default": true
          },
          "makeZip": {
            "title": "Also save everything as PACKAGE.zip",
            "type": "boolean",
            "description": "Bundle the clean GeoJSON, DDS draft, fix log, summary and all PDFs into PACKAGE.zip.",
            "default": true
          },
          "removeDuplicates": {
            "title": "Remove duplicate plots from the clean file",
            "type": "boolean",
            "description": "The EU system rejects duplicates. Off = keep and only warn.",
            "default": true
          },
          "sourceCrs": {
            "title": "Source coordinate system (only for metres)",
            "type": "string",
            "description": "Only if your file has coordinates in metres (e.g. UTM). Example: EPSG:32630. Leave empty for normal latitude/longitude."
          },
          "maxPlotsPerFile": {
            "title": "Max plots per GeoJSON file",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Clean output is split above this (EU: 1,000 producers per commodity line).",
            "default": 1000
          },
          "maxOutputFileMb": {
            "title": "Max clean file size (MB)",
            "minimum": 1,
            "maximum": 25,
            "type": "number",
            "description": "Clean GeoJSON is split below the EU 25 MB limit.",
            "default": 24
          },
          "maxPlots": {
            "title": "Max plots to process",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on plots per run (cost control). Extra plots are skipped and not charged.",
            "default": 200
          },
          "maxInputFileMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "number",
            "description": "Larger files are refused.",
            "default": 50
          },
          "concurrency": {
            "title": "Parallel workers",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Plots handled in parallel (PDFs and statistics).",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}