{
  "openapi": "3.1.0",
  "info": {
    "title": "Company Finders API",
    "version": "1.5.0",
    "summary": "Local businesses with no website, or with a broken or out-of-date one.",
    "description": "Counts the local businesses of one type near a city or in a whole country that list no website, builds a list of them with every listed website visited at the time of the order, and checks single websites. Cities and towns of more than 15,000 people, and capitals of any size, in 238 countries and territories, or one of those countries as a whole. Counting is free. A list costs 1 credit per business and a website check costs 1 credit, paid from a balance bought first at $3 per 1,000 credits. A Full SEO audit of one website costs 15 credits for each page audited (see POST /seo/audits). A call that fails costs nothing. A key may make 120 calls a minute. A business reported with no website may still have one it never linked on its listing, and a site reported as could_not_check is one we could not find out about that day (no answer after 4 tries, a page that stopped loading partway, a site that turned automated visitors away, or our time limit ran out), so it is not known to be broken or fine. Businesses whose listing marks them as permanently closed are left out, and are never counted or charged for; temporarily closed ones stay in.",
    "contact": {
      "name": "Company Finders",
      "email": "support@companyfinders.com",
      "url": "https://companyfinders.com/developers"
    },
    "termsOfService": "https://companyfinders.com/terms"
  },
  "externalDocs": {
    "description": "The API explained for a person, with examples, and where to get a key",
    "url": "https://companyfinders.com/developers"
  },
  "servers": [
    {
      "url": "https://companyfinders.com/api/v1"
    }
  ],
  "security": [
    {
      "key": []
    }
  ],
  "paths": {
    "/count": {
      "get": {
        "operationId": "count_businesses",
        "summary": "Count businesses with and without a website. Free.",
        "description": "Businesses whose listing marks them as permanently closed are left out, and are never counted or charged for; temporarily closed ones stay in. A search with no count kept from the last 30 days starts a new one. A key may start 200 a day (UTC), through /count and POST /lists together; past that the answer is 429, with Retry-After running to 00:00 UTC. A kept count uses none of the day's new counts.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A business type id, for example plumber. GET /types lists them."
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A city, written like \"Austin, TX\", \"Leeds, UK\", \"Toronto, ON\" or \"Mumbai, India\". GET /cities finds one. A name several cities share, such as \"Springfield\" or \"Kansas City\", is read as the largest of them in the six countries the API began with (the United States, the United Kingdom, Canada, Australia, New Zealand and Ireland), as it always was; a name none of those six has is read as the largest place that carries it. To be sure of the city, send its full label as /api/v1/cities gives it, for example \"Springfield, IL\" or \"Paris, France\". Send a country's name in English as city (United States, United Kingdom, India, Germany and so on) for one type in the whole country: radius_km is then ignored and min_reviews must be left out, so there is no distance and every business is counted. Some other common names (Türkiye, Czech Republic, UAE, USA) are answered with the name to send; any other spelling is not found, and GET /cities does not list countries. Lebanon and Jamaica are also towns of the United States, so for those two countries send country-lb or country-jm. There are no state or region lists."
            }
          },
          {
            "name": "radius_km",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Distance from the city centre in km. Ignored for a whole country.",
              "enum": [
                10,
                25,
                50,
                100,
                200
              ],
              "default": 25
            }
          },
          {
            "name": "min_reviews",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Only businesses with at least this many reviews.",
              "enum": [
                0,
                5,
                20
              ],
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The two counts, how many businesses a list would hold, and what it would cost.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Count"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        }
      }
    },
    "/lists": {
      "post": {
        "operationId": "build_list",
        "summary": "Start building a list. 1 credit per business.",
        "description": "Holds up to 10,000 businesses that list no website and up to 1,000 that list one, the most-reviewed of each. Answers at once with an id. Permanently closed businesses are left out and not charged for. The credits are held when the build starts and any the list did not use come back. A build takes one to three minutes around a city and a few minutes for a whole country: ask GET /lists/{id} every few seconds until status is done. A search with no count kept from the last 30 days starts a new one. A key may start 200 a day (UTC), through /count and POST /lists together; past that the answer is 429, with Retry-After running to 00:00 UTC. A kept count uses none of the day's new counts.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A business type id, for example plumber. GET /types lists them."
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A city, written like \"Austin, TX\", \"Leeds, UK\", \"Toronto, ON\" or \"Mumbai, India\". GET /cities finds one. A name several cities share, such as \"Springfield\" or \"Kansas City\", is read as the largest of them in the six countries the API began with (the United States, the United Kingdom, Canada, Australia, New Zealand and Ireland), as it always was; a name none of those six has is read as the largest place that carries it. To be sure of the city, send its full label as /api/v1/cities gives it, for example \"Springfield, IL\" or \"Paris, France\". Send a country's name in English as city (United States, United Kingdom, India, Germany and so on) for one type in the whole country: radius_km is then ignored and min_reviews must be left out, so there is no distance and every business is counted. Some other common names (Türkiye, Czech Republic, UAE, USA) are answered with the name to send; any other spelling is not found, and GET /cities does not list countries. Lebanon and Jamaica are also towns of the United States, so for those two countries send country-lb or country-jm. There are no state or region lists."
            }
          },
          {
            "name": "radius_km",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Distance from the city centre in km. Ignored for a whole country.",
              "enum": [
                10,
                25,
                50,
                100,
                200
              ],
              "default": 25
            }
          },
          {
            "name": "min_reviews",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Only businesses with at least this many reviews.",
              "enum": [
                0,
                5,
                20
              ],
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list, just started.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/List"
                    }
                  ],
                  "properties": {
                    "credits_remaining": {
                      "type": "integer",
                      "description": "Credits left on the key after the hold."
                    },
                    "place_chosen": {
                      "type": "string",
                      "description": "The full label of the city used. A count or new-list answer also has place_chosen, the full label of the city used, and other_places, the labels of up to 5 other places of that name, largest first, in three cases: the name is shared about evenly (the second largest city of the name has at least a quarter of the largest one's people, as with \"Springfield\"); a larger place in another country carries the name (\"Paris\" is read as Paris, TX, and Paris, France is named); or the name sent is another name of the city used that other places carry too (\"Calcutta\" is read as Kolkata, India, and Calcutta, South Africa is named). Both are left out otherwise."
                    },
                    "other_places": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 5,
                      "description": "The labels of up to 5 other cities of the name sent, largest first. Send one of them to count there instead."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "402": {
            "$ref": "#/components/responses/402"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        }
      }
    },
    "/lists/{id}": {
      "get": {
        "operationId": "get_list",
        "summary": "Where a list stands and, when done, every business in it. Free.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The id POST /lists answered with.",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "csv answers with the finished list as a file.",
              "enum": [
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list. When status is done it also holds results and data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinishedList"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "429": {
            "$ref": "#/components/responses/429"
          }
        }
      }
    },
    "/check": {
      "get": {
        "operationId": "check_website",
        "summary": "Visit one website now. 1 credit.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A website address, for example example.com.",
              "maxLength": 300
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the visit found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Check"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "402": {
            "$ref": "#/components/responses/402"
          },
          "429": {
            "$ref": "#/components/responses/429"
          }
        }
      }
    },
    "/seo/audits": {
      "post": {
        "operationId": "start_seo_audit",
        "summary": "Start a Full SEO audit of one website. 15 credits for each page audited.",
        "description": "A Full SEO audit costs 15 credits for each page audited, at most 1,500, with no minimum. The most its size can cost is held when it starts, and the rest comes back when it is done. An audit that cannot run costs 0 credits, and pages past its size are counted as not checked and not charged, and listed where the website's sitemap names them. Answers at once with an id: ask GET /seo/audits/{id} every few seconds until status is done. An address that forwards to another website, is a page on a larger website, did not answer or asks scanners not to visit is refused with 422 before anything is held. An audit nobody reads is settled within a day, the same way.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "site"
                ],
                "properties": {
                  "site": {
                    "type": "string",
                    "description": "The website, for example smithplumbing.com.",
                    "maxLength": 300
                  },
                  "size": {
                    "type": "integer",
                    "description": "The most pages the audit may open. Default 100.",
                    "enum": [
                      20,
                      50,
                      100
                    ],
                    "default": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The audit, just started.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The audit's id."
                    },
                    "status": {
                      "type": "string",
                      "description": "Where the audit stands. failed: it stopped on our side and every credit held was given back.",
                      "enum": [
                        "queued",
                        "running",
                        "done",
                        "failed",
                        "removed",
                        "expired"
                      ]
                    },
                    "site": {
                      "type": "string",
                      "description": "The website, as audited."
                    },
                    "size": {
                      "type": "integer",
                      "description": "The most pages the audit may open.",
                      "enum": [
                        20,
                        50,
                        100
                      ]
                    },
                    "credits_held": {
                      "type": "integer",
                      "description": "Credits held when it started: 15 for each page of its size, at most 1,500."
                    },
                    "credits_remaining": {
                      "type": "integer",
                      "description": "Credits left on the key after the hold."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "402": {
            "$ref": "#/components/responses/402"
          },
          "422": {
            "$ref": "#/components/responses/422"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          }
        }
      }
    },
    "/seo/audits/{id}": {
      "get": {
        "operationId": "get_seo_audit",
        "summary": "Where an audit stands and, when done, its result and what it cost. Free.",
        "description": "Reading a finished audit settles its credits, once. It never starts an audit.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The id POST /seo/audits answered with."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The audit.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The audit's id."
                    },
                    "status": {
                      "type": "string",
                      "description": "Where the audit stands. failed: it stopped on our side and every credit held was given back.",
                      "enum": [
                        "queued",
                        "running",
                        "done",
                        "failed",
                        "removed",
                        "expired"
                      ]
                    },
                    "site": {
                      "type": "string",
                      "description": "The website, as audited."
                    },
                    "size": {
                      "type": "integer",
                      "description": "The most pages the audit may open.",
                      "enum": [
                        20,
                        50,
                        100
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "description": "When it was started.",
                      "format": "date-time"
                    },
                    "finished_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When it finished."
                    },
                    "credits_held": {
                      "type": "integer",
                      "description": "Credits held when it started: 15 for each page of its size, at most 1,500."
                    },
                    "credits_charged": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "What it cost: 15 for each item in pages_audited, at most 1,500; 0 for a result with no score. Null until it is done."
                    },
                    "credits_given_back": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "credits_held less credits_charged, given back to the key when it finished. Null until it is done."
                    },
                    "pages_opened_so_far": {
                      "type": "integer",
                      "description": "While running: pages opened so far."
                    },
                    "error": {
                      "type": "string",
                      "description": "Present when status is failed."
                    },
                    "result": {
                      "type": "string",
                      "description": "scored, or no_score (the website could not be scanned that day: reason says why, and it costs nothing), or not_assessed (too few pages opened to score; costs nothing).",
                      "enum": [
                        "scored",
                        "no_score",
                        "not_assessed"
                      ]
                    },
                    "reason": {
                      "type": "string",
                      "description": "With no_score: why.",
                      "enum": [
                        "forwards",
                        "noanswer",
                        "robots",
                        "largersite",
                        "holding",
                        "unfinished",
                        "turnedaway",
                        "private"
                      ]
                    },
                    "reason_text": {
                      "type": "string",
                      "description": "With no_score or not_assessed: the reason in a sentence."
                    },
                    "score": {
                      "type": "integer",
                      "description": "Out of 100. Our own score, not a Google ranking factor."
                    },
                    "weakest_part": {
                      "type": "string",
                      "description": "The part with the lowest score.",
                      "enum": [
                        "reach",
                        "index",
                        "content",
                        "experience"
                      ]
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "part": {
                            "type": "string",
                            "description": "reach, index, content or experience."
                          },
                          "state": {
                            "type": "string",
                            "description": "not_checked when none of its checks could run.",
                            "enum": [
                              "scored",
                              "partial",
                              "not_checked"
                            ]
                          },
                          "score": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "checks_ran": {
                            "type": "integer",
                            "description": "Checks that could run."
                          },
                          "checks_total": {
                            "type": "integer",
                            "description": "Checks in the part."
                          }
                        }
                      }
                    },
                    "held_at_79": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Set when the score is held at 79 because fewer than 5 pages were found.",
                      "properties": {
                        "pages_found": {
                          "type": "integer",
                          "description": "Pages found."
                        }
                      }
                    },
                    "content_not_checked": {
                      "type": "boolean",
                      "description": "The website builds its pages in the browser, so the score is made of the other three parts."
                    },
                    "fix_first": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The issue's id. Stable: use it to match an issue across audits."
                          },
                          "title": {
                            "type": "string",
                            "description": "The issue, in a few plain words."
                          },
                          "what_it_means": {
                            "type": "string",
                            "description": "One sentence on what it means for the business."
                          },
                          "how_to_fix": {
                            "type": "string",
                            "description": "How to fix it."
                          },
                          "severity": {
                            "type": "string",
                            "description": "How much it matters. A note does not lower the score.",
                            "enum": [
                              "critical",
                              "warning",
                              "note"
                            ]
                          },
                          "part": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "reach",
                              "index",
                              "content",
                              "experience",
                              null
                            ],
                            "description": "The part of the score it counts in; null for a note."
                          },
                          "pages_affected": {
                            "type": "integer",
                            "description": "Pages it affects among the pages audited."
                          },
                          "pages_measured": {
                            "type": "integer",
                            "description": "Pages the check looked at."
                          },
                          "whole_site": {
                            "type": "boolean",
                            "description": "It is about the whole website, not some pages."
                          },
                          "points": {
                            "type": "number",
                            "description": "About how much fixing it is worth on the score out of 100; 0 for a note."
                          },
                          "points_are_estimate": {
                            "type": "boolean",
                            "description": "The points are an estimate."
                          },
                          "pages": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Every affected page among the pages audited, when the scan recorded them."
                          }
                        }
                      },
                      "description": "Up to 5 issues, the ones worth the most first."
                    },
                    "everything_else": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The issue's id. Stable: use it to match an issue across audits."
                          },
                          "title": {
                            "type": "string",
                            "description": "The issue, in a few plain words."
                          },
                          "what_it_means": {
                            "type": "string",
                            "description": "One sentence on what it means for the business."
                          },
                          "how_to_fix": {
                            "type": "string",
                            "description": "How to fix it."
                          },
                          "severity": {
                            "type": "string",
                            "description": "How much it matters. A note does not lower the score.",
                            "enum": [
                              "critical",
                              "warning",
                              "note"
                            ]
                          },
                          "part": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "reach",
                              "index",
                              "content",
                              "experience",
                              null
                            ],
                            "description": "The part of the score it counts in; null for a note."
                          },
                          "pages_affected": {
                            "type": "integer",
                            "description": "Pages it affects among the pages audited."
                          },
                          "pages_measured": {
                            "type": "integer",
                            "description": "Pages the check looked at."
                          },
                          "whole_site": {
                            "type": "boolean",
                            "description": "It is about the whole website, not some pages."
                          },
                          "points": {
                            "type": "number",
                            "description": "About how much fixing it is worth on the score out of 100; 0 for a note."
                          },
                          "points_are_estimate": {
                            "type": "boolean",
                            "description": "The points are an estimate."
                          },
                          "pages": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Every affected page among the pages audited, when the scan recorded them."
                          }
                        }
                      },
                      "description": "The other critical issues and warnings, in the same order."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The issue's id. Stable: use it to match an issue across audits."
                          },
                          "title": {
                            "type": "string",
                            "description": "The issue, in a few plain words."
                          },
                          "what_it_means": {
                            "type": "string",
                            "description": "One sentence on what it means for the business."
                          },
                          "how_to_fix": {
                            "type": "string",
                            "description": "How to fix it."
                          },
                          "severity": {
                            "type": "string",
                            "description": "How much it matters. A note does not lower the score.",
                            "enum": [
                              "critical",
                              "warning",
                              "note"
                            ]
                          },
                          "part": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "reach",
                              "index",
                              "content",
                              "experience",
                              null
                            ],
                            "description": "The part of the score it counts in; null for a note."
                          },
                          "pages_affected": {
                            "type": "integer",
                            "description": "Pages it affects among the pages audited."
                          },
                          "pages_measured": {
                            "type": "integer",
                            "description": "Pages the check looked at."
                          },
                          "whole_site": {
                            "type": "boolean",
                            "description": "It is about the whole website, not some pages."
                          },
                          "points": {
                            "type": "number",
                            "description": "About how much fixing it is worth on the score out of 100; 0 for a note."
                          },
                          "points_are_estimate": {
                            "type": "boolean",
                            "description": "The points are an estimate."
                          },
                          "pages": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Every affected page among the pages audited, when the scan recorded them."
                          }
                        }
                      },
                      "description": "Notes. They do not lower the score."
                    },
                    "more_findings": {
                      "type": "integer",
                      "description": "Findings from a check newer than our descriptions, left out of the lists above."
                    },
                    "more_findings_line": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The same, as a sentence; null when there are none."
                    },
                    "pages_audited": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Every page audited, in the order reached from the home page. credits_charged is 15 for each, at most 1,500."
                    },
                    "pages_not_checked": {
                      "type": "object",
                      "description": "Never charged.",
                      "properties": {
                        "not_opened": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "The page."
                              },
                              "why": {
                                "type": "string",
                                "description": "Why it was not checked.",
                                "enum": [
                                  "did not open",
                                  "forwards elsewhere",
                                  "asked us not to visit",
                                  "did not answer"
                                ]
                              }
                            }
                          }
                        },
                        "past_size": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "integer",
                              "description": "Pages found past the size."
                            },
                            "pages": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "list_complete": {
                              "type": "boolean",
                              "description": "false when not every page past the size is named."
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "429": {
            "$ref": "#/components/responses/429"
          }
        }
      }
    },
    "/types": {
      "get": {
        "operationId": "list_business_types",
        "summary": "Every business type that can be searched. Free.",
        "description": "Needs no key. Without one, an address may make 60 calls a minute to /types and /cities together; over that the answer is 429 with Retry-After. A key that is sent is checked (a wrong one gets 401) and counts toward its 120 a minute.",
        "security": [],
        "responses": {
          "200": {
            "description": "The types.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "The id the other calls take."
                          },
                          "name": {
                            "type": "string",
                            "description": "The name a person reads."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "429": {
            "$ref": "#/components/responses/429"
          }
        }
      }
    },
    "/cities": {
      "get": {
        "operationId": "find_cities",
        "summary": "Cities whose name starts with some letters. Free.",
        "description": "Needs no key. Without one, an address may make 60 calls a minute to /types and /cities together; over that the answer is 429 with Retry-After. A key that is sent is checked (a wrong one gets 401) and counts toward its 120 a minute.",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "At least 2 letters of a city's name.",
              "minLength": 2
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Up to 20 cities, written the way the other calls take them.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "429": {
            "$ref": "#/components/responses/429"
          }
        }
      }
    },
    "/balance": {
      "get": {
        "operationId": "get_balance",
        "summary": "How many credits the key holds. Free.",
        "responses": {
          "200": {
            "description": "The balance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credits": {
                      "type": "integer",
                      "description": "Credits on the key."
                    },
                    "usd": {
                      "type": "number",
                      "description": "What they cost, in US dollars."
                    },
                    "top_up": {
                      "type": "string",
                      "description": "Where to add to the balance.",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "429": {
            "$ref": "#/components/responses/429"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "key": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key, which starts with cf_. Get one at https://companyfinders.com/developers"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A short name for what went wrong."
              },
              "message": {
                "type": "string",
                "description": "What went wrong, in words."
              }
            }
          }
        }
      },
      "Count": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Business type id."
          },
          "city": {
            "type": "string",
            "description": "The city searched."
          },
          "radius_km": {
            "type": "integer",
            "description": "Distance searched, in km; 0 for a whole country."
          },
          "no_website": {
            "type": "integer",
            "description": "Businesses with a phone number that list no website. Permanently closed ones are not counted."
          },
          "with_website": {
            "type": "integer",
            "description": "Businesses that list a website. Permanently closed ones are not counted."
          },
          "list_size": {
            "type": "integer",
            "description": "Businesses a list would hold: up to 10,000 that list no website and up to 1,000 that list one, the most-reviewed of each. Less than no_website plus with_website when no_website is over 10,000 or with_website is over 1,000."
          },
          "list_cost_credits": {
            "type": "integer",
            "description": "Credits that list would cost."
          },
          "list_cost_usd": {
            "type": "number",
            "description": "The same in US dollars."
          },
          "counted_on": {
            "type": "string",
            "description": "The day of the count. A count is kept for up to 30 days.",
            "format": "date"
          },
          "place_chosen": {
            "type": "string",
            "description": "The full label of the city used. A count or new-list answer also has place_chosen, the full label of the city used, and other_places, the labels of up to 5 other places of that name, largest first, in three cases: the name is shared about evenly (the second largest city of the name has at least a quarter of the largest one's people, as with \"Springfield\"); a larger place in another country carries the name (\"Paris\" is read as Paris, TX, and Paris, France is named); or the name sent is another name of the city used that other places carry too (\"Calcutta\" is read as Kolkata, India, and Calcutta, South Africa is named). Both are left out otherwise."
          },
          "other_places": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 5,
            "description": "The labels of up to 5 other cities of the name sent, largest first. Send one of them to count there instead."
          }
        }
      },
      "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; 0 for a whole country."
          },
          "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."
          }
        }
      },
      "FinishedList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/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": "#/components/schemas/Business"
            }
          }
        }
      },
      "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), if the business is outside the United States, the United Kingdom, Canada, Australia, New Zealand and Ireland (that check reads English only), 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."
          },
          "domain_has_mail_server": {
            "type": [
              "string",
              "null"
            ],
            "description": "From our own check, added in 1.4.0: \"yes\" if the website's own domain listed a mail server (MX record) on the day we checked, \"no\" if it listed none or the domain does not exist. Empty text \"\" on a row with no website, a website on a builder's or social network's address, a lookup with no clear answer, or a list built before 1.4.0. It says nothing about any one mailbox."
          },
          "social_links": {
            "type": [
              "string",
              "null"
            ],
            "description": "From our own check, added in 1.4.0: the social media pages (Facebook, Instagram, LinkedIn, X, TikTok, YouTube) the home page links to, one per network, separated by \"; \". Empty text \"\" when the home page links to none, did not load, or the list was built before 1.4.0."
          }
        }
      },
      "Check": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The address asked about."
          },
          "result": {
            "type": "string",
            "description": "What the visit found.",
            "enum": [
              "no_website",
              "broken",
              "out_of_date",
              "loads_fine",
              "could_not_check"
            ]
          },
          "found": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The reasons, in words."
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The status the site answered with."
          },
          "email_on_site": {
            "type": [
              "string",
              "null"
            ],
            "description": "An email address shown on the page."
          },
          "built_with": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the site is built with, when that can be told."
          },
          "domain_has_mail_server": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the website's own domain lists a mail server (MX record) today: true, false (none listed, or the domain does not exist), or null (not asked for a builder's or social network's address, or no clear answer). Says nothing about any one mailbox."
          },
          "social_links": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The social media pages the home page links to, one per network."
          },
          "checked_on": {
            "type": "string",
            "description": "The day of the visit.",
            "format": "date"
          },
          "credits_remaining": {
            "type": "integer",
            "description": "Credits left on the key."
          }
        }
      }
    },
    "responses": {
      "400": {
        "description": "The request is not one the API can answer.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "401": {
        "description": "No key was sent, or the key is not known.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "402": {
        "description": "The key does not hold enough credits.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "Nothing was found: no such list or audit for this key, or no businesses of this type there.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "422": {
        "description": "The website cannot be audited as asked: it forwards to another website, is a page on a larger website, did not answer, or asks scanners not to visit. Nothing was charged.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "429": {
        "description": "Too many calls. Retry-After says how many seconds to wait, when the limit passes by itself.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "503": {
        "description": "New counts are paused for the day (counts already made still answer), or an audit could not start on our side. Nothing was charged.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}