{
    "openapi": "3.1.0",
    "info": {
        "title": "CDL Waypoint data API",
        "version": "1.0.0",
        "summary": "Clinics for the DOT physical, public CDL training locations, state medical card rules and fees.",
        "description": "Static, read-only JSON files rebuilt with every data update of https://cdldotguide.com/. No key, no rate plan: they are plain files, please cache them. Every count equals the count on the matching page.",
        "termsOfService": "https://cdldotguide.com/terms/",
        "contact": {
            "name": "CDL Waypoint",
            "url": "https://cdldotguide.com/contact/"
        }
    },
    "externalDocs": {
        "description": "About the API",
        "url": "https://cdldotguide.com/developers/"
    },
    "servers": [
        {
            "url": "https://cdldotguide.com/api/v1"
        }
    ],
    "security": [],
    "paths": {
        "/index.json": {
            "get": {
                "operationId": "getIndex",
                "summary": "Index: files, counts and sources",
                "responses": {
                    "200": {
                        "description": "Index: files, counts and sources",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Index"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such file (unknown state code)."
                    }
                }
            }
        },
        "/states.json": {
            "get": {
                "operationId": "listStates",
                "summary": "Every state and DC with counts and links",
                "responses": {
                    "200": {
                        "description": "Every state and DC with counts and links",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StateList"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such file (unknown state code)."
                    }
                }
            }
        },
        "/states/{state}.json": {
            "get": {
                "operationId": "getState",
                "summary": "One state: counts, rules, fees, cities",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/state"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One state: counts, rules, fees, cities",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/State"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such file (unknown state code)."
                    }
                }
            }
        },
        "/states/{state}/clinics.json": {
            "get": {
                "operationId": "listClinics",
                "summary": "Clinics of a state by city",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/state"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Clinics of a state by city",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ClinicList"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such file (unknown state code)."
                    }
                }
            }
        },
        "/states/{state}/schools.json": {
            "get": {
                "operationId": "listSchools",
                "summary": "Public CDL training locations of a state by city",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/state"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Public CDL training locations of a state by city",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SchoolList"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such file (unknown state code)."
                    }
                }
            }
        },
        "/tools.json": {
            "get": {
                "operationId": "listTools",
                "summary": "Calculators and finder with their inputs",
                "responses": {
                    "200": {
                        "description": "Calculators and finder with their inputs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ToolList"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No such file (unknown state code)."
                    }
                }
            }
        }
    },
    "components": {
        "parameters": {
            "state": {
                "name": "state",
                "in": "path",
                "required": true,
                "description": "Lowercase two-letter state code, DC included.",
                "schema": {
                    "type": "string",
                    "enum": [
                        "ak",
                        "al",
                        "ar",
                        "az",
                        "ca",
                        "co",
                        "ct",
                        "dc",
                        "de",
                        "fl",
                        "ga",
                        "hi",
                        "ia",
                        "id",
                        "il",
                        "in",
                        "ks",
                        "ky",
                        "la",
                        "ma",
                        "md",
                        "me",
                        "mi",
                        "mn",
                        "mo",
                        "ms",
                        "mt",
                        "nc",
                        "nd",
                        "ne",
                        "nh",
                        "nj",
                        "nm",
                        "nv",
                        "ny",
                        "oh",
                        "ok",
                        "or",
                        "pa",
                        "ri",
                        "sc",
                        "sd",
                        "tn",
                        "tx",
                        "ut",
                        "va",
                        "vt",
                        "wa",
                        "wi",
                        "wv",
                        "wy"
                    ]
                }
            }
        },
        "schemas": {
            "Meta": {
                "type": "object",
                "required": [
                    "api",
                    "version",
                    "url",
                    "data_as_of",
                    "terms"
                ],
                "properties": {
                    "api": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "page": {
                        "type": "string",
                        "format": "uri"
                    },
                    "data_as_of": {
                        "type": "string",
                        "format": "date"
                    },
                    "terms": {
                        "type": "object",
                        "properties": {
                            "url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "sources": {
                                "type": "string",
                                "format": "uri"
                            },
                            "attribution": {
                                "type": "string"
                            },
                            "licence": {
                                "type": "string"
                            },
                            "notes": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "Source": {
                "type": "object",
                "required": [
                    "title",
                    "url"
                ],
                "properties": {
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "Address": {
                "type": "object",
                "properties": {
                    "street": {
                        "type": "string"
                    },
                    "city": {
                        "type": "string"
                    },
                    "state": {
                        "type": "string"
                    },
                    "zip": {
                        "type": "string"
                    }
                }
            },
            "City": {
                "type": "object",
                "required": [
                    "name",
                    "slug",
                    "count",
                    "page",
                    "own_page",
                    "indexed"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "count": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "page": {
                        "type": "string",
                        "format": "uri"
                    },
                    "own_page": {
                        "type": "boolean"
                    },
                    "indexed": {
                        "type": "boolean",
                        "description": "Whether the city page is open to search engines."
                    }
                }
            },
            "Index": {
                "type": "object",
                "required": [
                    "meta",
                    "counts",
                    "files",
                    "sources"
                ],
                "properties": {
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    },
                    "description": {
                        "type": "string"
                    },
                    "counts": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    "files": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "path": {
                                    "type": "string"
                                },
                                "what": {
                                    "type": "string"
                                },
                                "url": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "openapi": {
                        "type": "string",
                        "format": "uri"
                    },
                    "catalog": {
                        "type": "string",
                        "format": "uri"
                    },
                    "sources": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "url": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "as_of": {
                                    "type": "string",
                                    "format": "date"
                                },
                                "licence": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "StatePages": {
                "type": "object",
                "properties": {
                    "hub": {
                        "type": "string",
                        "format": "uri"
                    },
                    "cdl_schools": {
                        "type": "string",
                        "format": "uri"
                    },
                    "dot_physical": {
                        "type": "string",
                        "format": "uri"
                    },
                    "medical_card_rules": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "StateList": {
                "type": "object",
                "required": [
                    "meta",
                    "states"
                ],
                "properties": {
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    },
                    "states": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "code": {
                                    "type": "string"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "slug": {
                                    "type": "string"
                                },
                                "data": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "pages": {
                                    "$ref": "#/components/schemas/StatePages"
                                },
                                "counts": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "integer",
                                        "minimum": 0
                                    }
                                },
                                "has_checked_rules": {
                                    "type": "boolean"
                                }
                            }
                        }
                    }
                }
            },
            "Fee": {
                "type": "object",
                "properties": {
                    "item": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "usd": {
                        "type": "number"
                    },
                    "note": {
                        "type": "string"
                    },
                    "source": {
                        "$ref": "#/components/schemas/Source"
                    }
                }
            },
            "State": {
                "type": "object",
                "required": [
                    "meta",
                    "code",
                    "name",
                    "counts",
                    "cities"
                ],
                "properties": {
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    },
                    "code": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "pages": {
                        "$ref": "#/components/schemas/StatePages"
                    },
                    "counts": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    "motor_vehicle_agency": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "source": {
                                "$ref": "#/components/schemas/Source"
                            },
                            "checked": {
                                "type": "string",
                                "format": "date"
                            }
                        }
                    },
                    "medical_card_rules": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "agency": {
                                        "type": "string"
                                    },
                                    "page": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "checked": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "facts": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "topic": {
                                                    "type": "string"
                                                },
                                                "text": {
                                                    "type": "string"
                                                },
                                                "source": {
                                                    "$ref": "#/components/schemas/Source"
                                                },
                                                "checked": {
                                                    "type": "string",
                                                    "format": "date"
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "federal_rules_page": {
                        "type": "string",
                        "format": "uri"
                    },
                    "fees": {
                        "type": "object",
                        "properties": {
                            "checked": {
                                "type": "string",
                                "format": "date"
                            },
                            "page": {
                                "type": "string",
                                "format": "uri"
                            },
                            "published_online": {
                                "type": "boolean"
                            },
                            "summary": {
                                "type": "object",
                                "additionalProperties": {
                                    "oneOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "label": {
                                                    "type": "string"
                                                },
                                                "usd": {
                                                    "type": "number"
                                                },
                                                "as_published": {
                                                    "type": "string"
                                                },
                                                "note": {
                                                    "type": "string"
                                                }
                                            }
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            },
                            "items": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Fee"
                                }
                            }
                        }
                    },
                    "class_a_tuition": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "program": {
                                        "type": "string"
                                    },
                                    "prices_found": {
                                        "type": "integer",
                                        "minimum": 0
                                    },
                                    "median_usd": {
                                        "type": "number"
                                    },
                                    "lowest_usd": {
                                        "type": "number"
                                    },
                                    "highest_usd": {
                                        "type": "number"
                                    },
                                    "checked": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "page": {
                                        "type": "string",
                                        "format": "uri"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "cost_estimate_inputs": {
                        "type": "object",
                        "properties": {
                            "school_median_usd": {
                                "oneOf": [
                                    {
                                        "type": "integer",
                                        "minimum": 0
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "school_prices_found": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "tool": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    },
                    "cities": {
                        "type": "object",
                        "properties": {
                            "dot_physical": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/City"
                                }
                            },
                            "cdl_schools": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/City"
                                }
                            }
                        }
                    },
                    "listings": {
                        "type": "object",
                        "properties": {
                            "clinics": {
                                "type": "string",
                                "format": "uri"
                            },
                            "schools": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    }
                }
            },
            "Clinic": {
                "type": "object",
                "required": [
                    "name",
                    "source",
                    "address"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "legal_name": {
                        "type": "string"
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "nppes",
                            "networks"
                        ]
                    },
                    "npi": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "types": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "address": {
                        "$ref": "#/components/schemas/Address"
                    },
                    "phone": {
                        "type": "string"
                    },
                    "network": {
                        "type": "string"
                    },
                    "open": {
                        "type": "boolean"
                    },
                    "status_note": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "hours": {
                        "type": "string"
                    },
                    "dot_physicals_offered_per_network": {
                        "type": "boolean"
                    },
                    "network_statement": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "text": {
                                        "type": "string"
                                    },
                                    "url": {
                                        "type": "string",
                                        "format": "uri"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "note": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "location_page": {
                        "type": "string",
                        "format": "uri"
                    },
                    "checked": {
                        "type": "string",
                        "format": "date"
                    },
                    "also_in_nppes": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "npi": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "ClinicList": {
                "type": "object",
                "required": [
                    "meta",
                    "state",
                    "count",
                    "cities"
                ],
                "properties": {
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    },
                    "state": {
                        "type": "string"
                    },
                    "count": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "verify": {
                        "type": "string"
                    },
                    "national_registry": {
                        "type": "string",
                        "format": "uri"
                    },
                    "cities": {
                        "type": "array",
                        "items": {
                            "allOf": [
                                {
                                    "$ref": "#/components/schemas/City"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "clinics": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Clinic"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            },
            "School": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "page",
                    "location_type"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "provider": {
                        "type": "string"
                    },
                    "page": {
                        "type": "string",
                        "format": "uri"
                    },
                    "location_type": {
                        "type": "string",
                        "enum": [
                            "in_person",
                            "traveling"
                        ]
                    },
                    "address": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/Address"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "phone": {
                        "type": "string"
                    },
                    "website": {
                        "oneOf": [
                            {
                                "type": "string",
                                "format": "uri"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "training": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "object",
                            "properties": {
                                "label": {
                                    "type": "string"
                                },
                                "registered": {
                                    "type": "boolean"
                                },
                                "full": {
                                    "type": "boolean"
                                },
                                "parts": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "enum": [
                                            "theory",
                                            "range",
                                            "road"
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "published_price": {
                        "oneOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "usd": {
                                        "type": "number"
                                    },
                                    "program": {
                                        "type": "string"
                                    },
                                    "read_on": {
                                        "type": "string",
                                        "format": "date"
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "SchoolList": {
                "type": "object",
                "required": [
                    "meta",
                    "state",
                    "count",
                    "cities",
                    "traveling"
                ],
                "properties": {
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    },
                    "state": {
                        "type": "string"
                    },
                    "count": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "private_enrollment_only_not_listed": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "verify": {
                        "type": "string"
                    },
                    "registry": {
                        "type": "string",
                        "format": "uri"
                    },
                    "training_parts": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "cities": {
                        "type": "array",
                        "items": {
                            "allOf": [
                                {
                                    "$ref": "#/components/schemas/City"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "schools": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/School"
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "traveling": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/School"
                        }
                    }
                }
            },
            "ToolList": {
                "type": "object",
                "required": [
                    "meta",
                    "tools"
                ],
                "properties": {
                    "meta": {
                        "$ref": "#/components/schemas/Meta"
                    },
                    "note": {
                        "type": "string"
                    },
                    "national_figures": {
                        "type": "object"
                    },
                    "tools": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "name",
                                "page",
                                "input_schema"
                            ],
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "title": {
                                    "type": "string"
                                },
                                "page": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "description": {
                                    "type": "string"
                                },
                                "input_schema": {
                                    "type": "object",
                                    "description": "JSON Schema of the tool input."
                                },
                                "rules": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "label": {
                                                "type": "string"
                                            },
                                            "url": {
                                                "type": "string",
                                                "format": "uri"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
