{
  "openapi": "3.0.1",
  "info": {
    "title": "US Firearms License (FFL) & Gun Dealer Leads Scraper",
    "description": "Scrape the official ATF Federal Firearms Licensee (FFL) registry: 130k+ licensed gun dealers, gunsmiths, manufacturers, importers & pawnbrokers with business name, full address, phone, license type & lead score. Filter by state & type. B2B firearms-industry leads + new-license monitoring.",
    "version": "0.1",
    "x-build-id": "KSKCr2zXBPlavik2g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-firearms-license-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-firearms-license-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-firearms-license-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-firearms-license-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-firearms-license-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-firearms-license-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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Filter by the licensee's premise (business) state — two-letter USPS codes, e.g. <code>TX</code>, <code>FL</code>, <code>CA</code>, <code>PA</code>. Leave empty for all 50 states + territories.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Filter by the premise city (case-insensitive, exact city name), e.g. <code>Houston</code>, <code>Miami</code>, <code>Phoenix</code>.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes (prefix)",
            "type": "array",
            "description": "Filter by premise ZIP — full ZIP (<code>77002</code>) or a prefix (<code>770</code> matches all 770xx).",
            "items": {
              "type": "string"
            }
          },
          "licenseTypes": {
            "title": "License types",
            "type": "array",
            "description": "Filter by ATF license type. Leave empty for all (collectors excluded by default — see below). Type 01 (dealers/gunsmiths) is by far the most common.",
            "items": {
              "type": "string",
              "enum": [
                "01",
                "02",
                "03",
                "06",
                "07",
                "08",
                "09",
                "10",
                "11"
              ],
              "enumTitles": [
                "01 — Dealer / Gunsmith",
                "02 — Pawnbroker",
                "03 — Collector of Curios & Relics",
                "06 — Manufacturer of Ammunition",
                "07 — Manufacturer of Firearms",
                "08 — Importer of Firearms",
                "09 — Dealer in Destructive Devices",
                "10 — Manufacturer of Destructive Devices",
                "11 — Importer of Destructive Devices"
              ]
            }
          },
          "licenseCategories": {
            "title": "License categories",
            "type": "array",
            "description": "Higher-level grouping of license types. <b>Dealer</b> = 01/09, <b>Pawnbroker</b> = 02, <b>Manufacturer</b> = 06/07/10, <b>Importer</b> = 08/11, <b>Collector</b> = 03. Combine with or instead of specific license types.",
            "items": {
              "type": "string",
              "enum": [
                "Dealer",
                "Pawnbroker",
                "Manufacturer",
                "Importer",
                "Collector"
              ],
              "enumTitles": [
                "Dealer",
                "Pawnbroker",
                "Manufacturer",
                "Importer",
                "Collector"
              ]
            }
          },
          "excludeCollectors": {
            "title": "Exclude Curio & Relic collectors (Type 03)",
            "type": "boolean",
            "description": "Type 03 (Collector of Curios & Relics) licenses are held by individual hobbyists, not businesses. Excluding them gives a clean B2B list of dealers, gunsmiths, manufacturers and importers. Turn off to include collectors.",
            "default": true
          },
          "businessOnly": {
            "title": "Business name present only",
            "type": "boolean",
            "description": "Only return licensees that have a business / trade name (DBA) on file — a strong signal of an established, contactable business rather than a home-based individual.",
            "default": false
          },
          "withPhoneOnly": {
            "title": "With phone number only",
            "type": "boolean",
            "description": "Only return licensees that have a voice phone number on file.",
            "default": false
          },
          "businessNameContains": {
            "title": "Business name contains",
            "type": "string",
            "description": "Only return licensees whose business / trade name contains this text (case-insensitive), e.g. <code>pawn</code>, <code>guns</code>, <code>tactical</code>, <code>armory</code>, <code>sporting</code>."
          },
          "licenseeNameContains": {
            "title": "Licensee name contains",
            "type": "string",
            "description": "Only return licensees whose legal license name contains this text (case-insensitive) — e.g. an individual or company name."
          },
          "nameContains": {
            "title": "Any name contains",
            "type": "string",
            "description": "Match against EITHER the licensee legal name OR the business / trade name (case-insensitive). Use this for a broad keyword sweep."
          },
          "regionCodes": {
            "title": "ATF region codes (advanced)",
            "type": "array",
            "description": "Advanced: filter by the first digit of the FFL number — the ATF licensing region code. Most users should filter by state instead.",
            "items": {
              "type": "string"
            }
          },
          "countyCodes": {
            "title": "ATF county codes (advanced)",
            "type": "array",
            "description": "Advanced: filter by the ATF 3-digit county code as it appears in the FFL number. Most users should filter by state / city / ZIP instead.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of FFL records to return in this run. The official ATF business export holds ~77,000 active licensees (dealers, gunsmiths, manufacturers, importers and pawnbrokers).",
            "default": 1000
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "leadScore",
              "businessName",
              "state",
              "source"
            ],
            "type": "string",
            "description": "<b>Lead score</b> = highest-value B2B licensees first (recommended). <b>Business name / State</b> = alphabetical. <b>Source order</b> = fastest on very large limits (file order).",
            "default": "leadScore"
          },
          "monitorMode": {
            "title": "Monitoring mode — only new licensees",
            "type": "boolean",
            "description": "Remember which FFLs were already returned (in a named key-value store) and emit ONLY licensees that are new since the last run — each tagged <code>monitorEvent: \"new\"</code>. The ATF refreshes the registry monthly; run this on a Schedule to capture newly-licensed firearms businesses as fresh leads. Works alongside Apify Schedules (the schedule starts the run; monitoring decides what's new).",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the memory used by monitoring mode. Use a distinct key per saved watch (e.g. per state or license type) so different monitors don't share state.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "The actor downloads the official ATF CSV directly and needs no proxy in almost all cases — leave this off for the fastest, free download. If a direct download ever fails, the actor automatically retries through Apify Residential (US) proxy as a fallback. Enable a proxy here only if you specifically need to route traffic.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}