{
  "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 & certified products. Filter by state, status, scope, business type & product. B2B leads + organic market intelligence + monitoring. Official USDA Organic INTEGRITY data, no browser.",
    "version": "0.1",
    "x-build-id": "d6S3EPODSWcIXzoKM"
  },
  "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 (case-insensitive contains). 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. Empty = all states.",
            "items": {
              "type": "string"
            }
          },
          "certificationStatuses": {
            "title": "Certification status",
            "type": "array",
            "description": "Which certification statuses to include. Default keeps only currently Certified operations.",
            "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 a status in at least one of these NOP scopes. 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/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 (matched against item name, category & varieties), e.g. [\"coffee\", \"hemp\", \"beef\", \"olive oil\"].",
            "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 name (case-insensitive exact match). Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "withEmailOnly": {
            "title": "Only with email",
            "type": "boolean",
            "description": "Keep only operations that have a contact email.",
            "default": false
          },
          "withPhoneOnly": {
            "title": "Only with phone",
            "type": "boolean",
            "description": "Keep only operations that have a phone number.",
            "default": false
          },
          "withWebsiteOnly": {
            "title": "Only with website",
            "type": "boolean",
            "description": "Keep only operations that have a 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."
          },
          "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 full certified-product list per operation (scope, category, item, varieties, status). Product counts & scopes 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.",
            "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 — e.g. newly certified, suspended or surrendered operations. 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}