{
  "openapi": "3.0.1",
  "info": {
    "title": "AgriTech B2B Buyer Discovery",
    "description": "Find international B2B buyers for agricultural commodities on global trade directories",
    "version": "0.1",
    "x-build-id": "VQSNEpGxAce3dDqm6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sherlock_labs~agritech-buyer-discovery/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sherlock_labs-agritech-buyer-discovery",
        "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/sherlock_labs~agritech-buyer-discovery/runs": {
      "post": {
        "operationId": "runs-sync-sherlock_labs-agritech-buyer-discovery",
        "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/sherlock_labs~agritech-buyer-discovery/run-sync": {
      "post": {
        "operationId": "run-sync-sherlock_labs-agritech-buyer-discovery",
        "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": [
          "commodities"
        ],
        "properties": {
          "commodities": {
            "title": "Commodities to Search",
            "type": "array",
            "description": "List of products to search for buyers. Be specific for better matches. Examples: 'lemongrass essential oil', 'basmati rice', 'turmeric powder', 'black pepper'",
            "default": [
              "lemongrass essential oil",
              "citronella oil"
            ],
            "items": {
              "type": "string"
            }
          },
          "buyerCountries": {
            "title": "Buyer Countries (leave empty for all)",
            "type": "array",
            "description": "Only show leads from these countries. Leave empty for worldwide results. Supports full names (United States), abbreviations (US, UK, UAE), and common aliases (America, Britain, Dubai).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeUnknownCountries": {
            "title": "Include Leads with Unknown Country",
            "type": "boolean",
            "description": "When a country filter is set, should leads with no detectable country still be included? True = keep them (safer, fewer misses). False = only show leads from detected countries matching your filter.",
            "default": true
          },
          "maxPages": {
            "title": "Max Pages per Platform",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of result pages to scrape per commodity per platform. More pages = more results but higher cost and runtime. Recommended: 3–5 for daily runs.",
            "default": 5
          },
          "maxRequestsPerCrawl": {
            "title": "Max Total Requests (Cost Cap)",
            "minimum": 10,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard cap on total HTTP requests across the entire run. Use this to control cost. Default 200 is enough for 2 commodities × 7 platforms × 5 pages. Increase for larger searches.",
            "default": 200
          },
          "minOrderQuantityKg": {
            "title": "Minimum Order Quantity (kg)",
            "minimum": 0,
            "type": "integer",
            "description": "Filter out leads below this quantity. Set to 0 to include all leads regardless of order size. Note: most leads don't specify quantity and will pass regardless.",
            "default": 25
          },
          "maxLeadAgeDays": {
            "title": "Maximum Lead Age (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Only include leads posted within this many days. Set to 365 for maximum coverage. Leads ≤7 days old will be marked as 🔥 Fresh.",
            "default": 30
          },
          "notifyWebhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "Optional HTTP POST endpoint to notify when the actor completes. Receives JSON with lead counts and summary. Leave empty to disable.",
            "default": ""
          },
          "debugMode": {
            "title": "Debug Mode",
            "type": "boolean",
            "description": "Save raw HTML from each page to Key-Value Store for troubleshooting extraction issues. Check Key-Value Store tab after the run for DEBUG_* files. Disable for production runs.",
            "default": false
          },
          "proxyConfig": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "RESIDENTIAL proxies give the best results — highly recommended for Alibaba and IndiaMart. Datacenter proxies may work for TradeIndia and EC21.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}