{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/companyfinders-com/json-schema/companyfinders-com-finished-list-schema.json",
  "title": "FinishedList",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/companyfinders-com-openapi.yml#/components/schemas/FinishedList",
  "allOf": [
    {
      "$ref": "#/$defs/List"
    }
  ],
  "properties": {
    "results": {
      "type": "object",
      "description": "How many businesses got each result.",
      "properties": {
        "no_website": {
          "type": "integer"
        },
        "broken": {
          "type": "integer"
        },
        "out_of_date": {
          "type": "integer"
        },
        "loads_fine": {
          "type": "integer"
        },
        "could_not_check": {
          "type": "integer"
        }
      }
    },
    "data": {
      "type": "array",
      "description": "Every business, leads first. The same columns as the file.",
      "items": {
        "$ref": "#/$defs/Business"
      }
    }
  },
  "$defs": {
    "Business": {
      "type": "object",
      "description": "One business, with the same columns as the file. Businesses whose listing marks them as permanently closed are left out, and are never counted or charged for; temporarily closed ones stay in.",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "category": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "address": {
          "type": [
            "string",
            "null"
          ]
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "region": {
          "type": [
            "string",
            "null"
          ]
        },
        "postcode": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "rating": {
          "type": [
            "number",
            "null"
          ],
          "description": "rating"
        },
        "reviews": {
          "type": [
            "number",
            "null"
          ],
          "description": "reviews"
        },
        "website": {
          "type": [
            "string",
            "null"
          ]
        },
        "result": {
          "type": "string",
          "description": "What the website check found.",
          "enum": [
            "No website",
            "Broken",
            "Out of date",
            "Loads fine",
            "Could not check"
          ]
        },
        "what_we_found": {
          "type": [
            "string",
            "null"
          ]
        },
        "website_checked_on": {
          "type": [
            "string",
            "null"
          ]
        },
        "email_on_site": {
          "type": [
            "string",
            "null"
          ]
        },
        "built_with": {
          "type": [
            "string",
            "null"
          ]
        },
        "google_profile_claimed": {
          "type": [
            "string",
            "null"
          ]
        },
        "listing_updated_on": {
          "type": [
            "string",
            "null"
          ],
          "description": "The day our data provider last refreshed the Google listing. It is not a day the business changed anything."
        },
        "google_maps_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "latitude": {
          "type": [
            "number",
            "null"
          ],
          "description": "latitude"
        },
        "longitude": {
          "type": [
            "number",
            "null"
          ],
          "description": "longitude"
        },
        "hours_on_listing": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opening hours, for example \"Mon-Fri 07:00-18:00; Sat 08:00-12:00; Sun closed\". As shown on the Google listing when we fetched it; empty text \"\" if the listing showed none or the list was built before 1.1.0."
        },
        "temporarily_closed": {
          "type": [
            "string",
            "null"
          ],
          "description": "\"yes\" if the listing was marked temporarily closed, otherwise empty text \"\". As shown on the Google listing when we fetched it; empty text \"\" if the listing showed none or the list was built before 1.1.0."
        },
        "photos_on_listing": {
          "type": [
            "integer",
            "null"
          ],
          "description": "How many photos the listing had. As shown on the Google listing when we fetched it; null if the listing gave no count or the list was built before 1.1.0."
        },
        "other_categories": {
          "type": [
            "string",
            "null"
          ],
          "description": "The listing's other categories, separated by \"; \". As shown on the Google listing when we fetched it; empty text \"\" if the listing showed none or the list was built before 1.1.0."
        },
        "description_on_listing": {
          "type": [
            "string",
            "null"
          ],
          "description": "The description the listing carried. Empty text \"\" if the listing showed none, if it names a person (a simple text check that can miss some), or if the list was built before 1.1.0."
        },
        "google_place_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Google's stable id for the listing, for matching a business in a later list to the same one in an earlier list. Empty text \"\" in lists built before 1.1.0."
        },
        "same_phone_listing_with_website": {
          "type": [
            "string",
            "null"
          ],
          "description": "Only on a row with no website: another listing in the same list has the same phone number and shows a website; this names that listing and its website (several are separated by \"; \"). The row stays a no-website row, because its own listing shows none. Empty text \"\" otherwise, and in lists built before 1.1.0."
        }
      }
    },
    "List": {
      "type": "object",
      "description": "Businesses whose listing marks them as permanently closed are left out, and are never counted or charged for; temporarily closed ones stay in.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The list's id.",
          "format": "uuid"
        },
        "status": {
          "type": "string",
          "description": "Where the build stands.",
          "enum": [
            "queued",
            "running",
            "done",
            "failed"
          ]
        },
        "type": {
          "type": "string",
          "description": "Business type id."
        },
        "city": {
          "type": "string",
          "description": "The city searched."
        },
        "radius_km": {
          "type": "integer",
          "description": "Distance searched, in km."
        },
        "websites_checked": {
          "type": "integer",
          "description": "Websites visited so far."
        },
        "websites_to_check": {
          "type": "integer",
          "description": "Websites this list has to visit."
        },
        "businesses": {
          "type": "integer",
          "description": "Businesses in the list. Permanently closed ones are left out and not charged for."
        },
        "leads": {
          "type": "integer",
          "description": "Businesses with no website, a broken one or an out-of-date one."
        },
        "credits_held": {
          "type": "integer",
          "description": "Credits this list holds. Credits it did not use are given back when it finishes."
        },
        "created_at": {
          "type": "string",
          "description": "When the list was asked for.",
          "format": "date-time"
        },
        "finished_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the build finished."
        },
        "error": {
          "type": "string",
          "description": "Present when status is failed: what happened. The credits held were given back."
        }
      }
    }
  }
}