{
  "openapi": "3.0.1",
  "info": {
    "title": "USDA Organic Operations Scraper - Certified Business Leads",
    "description": "Scrape every USDA-certified organic operation: name, contact, phone, email, website, certifier, status, scopes and certified products. Filter by state, county, scope, business type and product keyword. B2B leads, market intel and monitoring. Independent tool, not affiliated with the USDA.",
    "version": "0.1",
    "x-build-id": "Tq3u1Q2Fsj2VJCZnG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-organic-operations-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-organic-operations-scraper",
        "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/scrapesage~us-organic-operations-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-organic-operations-scraper",
        "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/scrapesage~us-organic-operations-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-organic-operations-scraper",
        "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": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Filter by operation country. A value matches at the start of a word, so \"United States\", \"USA\" and \"US\" all mean the United States of America and \"US\" no longer matches Australia or Russia. The INTEGRITY database is global; the default keeps US operations only. Clear it to include every country.",
            "default": [
              "United States"
            ],
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Filter by physical-address state: two-letter codes (e.g. [\"CA\", \"TX\"]) or full names. Full names also work for provinces in other countries. Empty = all states.",
            "items": {
              "type": "string"
            }
          },
          "certificationStatuses": {
            "title": "Certification status",
            "type": "array",
            "description": "Which certification statuses to include. Default keeps only currently Certified operations. Together with Certification scopes, the operation must hold this status in one of the chosen scopes.",
            "items": {
              "type": "string",
              "enum": [
                "Certified",
                "Surrendered",
                "Suspended",
                "Revoked"
              ],
              "enumTitles": [
                "Certified",
                "Surrendered",
                "Suspended",
                "Revoked"
              ]
            },
            "default": [
              "Certified"
            ]
          },
          "scopes": {
            "title": "Certification scopes",
            "type": "array",
            "description": "Keep only operations that hold at least one of these NOP scopes. With a status filter the scope itself must have that status, so Certified + Livestock means currently certified for livestock (not a farm whose livestock certification was surrendered). Empty = all scopes.",
            "items": {
              "type": "string",
              "enum": [
                "crops",
                "livestock",
                "wildCrops",
                "handling"
              ],
              "enumTitles": [
                "Crops",
                "Livestock",
                "Wild Crops",
                "Handling (processing/packaging)"
              ]
            }
          },
          "businessTypes": {
            "title": "Business types",
            "type": "array",
            "description": "Keep only operations flagged with at least one of these business activities. Great for targeting commercial buyers and sellers (brokers, distributors, co-packers, retailers).",
            "items": {
              "type": "string",
              "enum": [
                "broker",
                "distributor",
                "copacker",
                "marketerTrader",
                "privateLabeler",
                "retailer",
                "restaurant",
                "storage",
                "slaughterHouse",
                "poultry",
                "dairy",
                "csa",
                "growerGroup"
              ],
              "enumTitles": [
                "Broker",
                "Distributor",
                "Co-Packer",
                "Marketer/Trader",
                "Private Labeler",
                "Retail Food Establishment",
                "Restaurant",
                "Storage",
                "Slaughterhouse",
                "Poultry",
                "Dairy",
                "CSA",
                "Grower Group"
              ]
            }
          },
          "productKeywords": {
            "title": "Product keywords",
            "type": "array",
            "description": "Keep only operations certified for products matching any of these keywords (item name, category and varieties), e.g. [\"coffee\", \"hemp\", \"beef\", \"olive oil\"]. A keyword matches at the start of a word: \"tea\" finds tea but not steak, \"apple\" finds apples but not pineapple.",
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Name contains",
            "type": "string",
            "description": "Only operations whose name (or former name) contains this text (case-insensitive)."
          },
          "certifierName": {
            "title": "Certifier contains",
            "type": "string",
            "description": "Only operations whose certifying agent name contains this text, e.g. \"CCOF\" or \"Oregon Tilth\"."
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Filter by physical-address city (case-insensitive exact match). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Filter by 5-digit physical-address ZIP code. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Filter by physical-address county, e.g. \"Fresno\" or \"Fresno County\" (case-insensitive). Where USDA left the county blank, it is filled from the ZIP code when at least three quarters of the other USDA records in that ZIP name the same county (see physicalCountySource in the output). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "withEmailOnly": {
            "title": "Only with email",
            "type": "boolean",
            "description": "Keep only operations that have a valid email address.",
            "default": false
          },
          "withPhoneOnly": {
            "title": "Only with phone",
            "type": "boolean",
            "description": "Keep only operations that have a real phone number (placeholders such as 0000000000 do not count).",
            "default": false
          },
          "withWebsiteOnly": {
            "title": "Only with website",
            "type": "boolean",
            "description": "Keep only operations that have a valid website URL.",
            "default": false
          },
          "withContactOnly": {
            "title": "Only with email or phone",
            "type": "boolean",
            "description": "Keep only operations that have at least a phone or an email: the highest-value leads.",
            "default": false
          },
          "certifiedAfter": {
            "title": "Status effective on/after",
            "type": "string",
            "description": "Only operations whose certification status took effect on/after this date (YYYY-MM-DD). Great for finding newly certified operations. A value that is not a date stops the run before anything is billed."
          },
          "certifiedBefore": {
            "title": "Status effective on/before",
            "type": "string",
            "description": "Only operations whose certification status took effect on/before this date (YYYY-MM-DD)."
          },
          "updatedAfter": {
            "title": "Updated on/after",
            "type": "string",
            "description": "Only operations whose record was last updated on/after this date (YYYY-MM-DD)."
          },
          "includeItems": {
            "title": "Include certified products (items)",
            "type": "boolean",
            "description": "Include the certified-product list per operation (scope, category, item, varieties, status). Product counts, scopes and top products are always included regardless.",
            "default": true
          },
          "maxItemsPerOperation": {
            "title": "Max products per operation",
            "type": "integer",
            "description": "Cap the products array per operation to keep records compact.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "statusEffectiveDate",
              "anniversaryDate",
              "leadScore",
              "itemsCount",
              "name"
            ],
            "type": "string",
            "description": "Order of the returned operations.",
            "default": "statusEffectiveDate"
          },
          "maxResults": {
            "title": "Max results",
            "type": "integer",
            "description": "Maximum number of operation records to return. A run with no filters at all (an empty API call) returns a 25-record sample instead of this default.",
            "default": 1000
          },
          "deduplicateResults": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Drop duplicate operations within a run.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitoring mode (only new operations)",
            "type": "boolean",
            "description": "Remember which operations were already returned and, on the next run with the same monitor key, emit only operations that are new or whose certification status changed since then (newly certified, suspended or surrendered operations). Each row says which: monitorEvent \"new\" or \"statusChanged\" with the previous status. Works alongside Apify Schedules.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "A label for this saved watch (e.g. \"ca-handlers\"). Use a distinct key per saved search.",
            "default": "default"
          },
          "apiKey": {
            "title": "api.data.gov API key (advanced)",
            "type": "string",
            "description": "Optional. A free api.data.gov key for the USDA Organic INTEGRITY API. Leave empty to use the built-in shared key (one ~24 MB download per run, well within limits). Get your own key at https://api.data.gov/signup/."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. The USDA Organic INTEGRITY API is a public source reachable without a proxy (the default).",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}