{
  "openapi": "3.1.0",
  "info": {
    "title": "CamperPartFinder part-number lookup",
    "version": "1.0",
    "description": "Read-only lookup of documented replacements and cross-references for caravan, motorhome and RV part numbers. Every relationship includes its source. Fitment to vehicles is not asserted. Rate-limited; see https://camperpartfinder.com/terms/."
  },
  "servers": [
    {
      "url": "https://camperpartfinder.com"
    }
  ],
  "paths": {
    "/api/lookup/": {
      "get": {
        "operationId": "lookupPart",
        "summary": "Find replacements and cross-references for a part number",
        "parameters": [
          {
            "name": "part",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 70
            },
            "description": "Part number. Spaces, dashes, dots and case are ignored; letters and digits are significant."
          },
          {
            "name": "manufacturer",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 80
            },
            "description": "Optional manufacturer name or slug to disambiguate."
          }
        ],
        "responses": {
          "200": {
            "description": "Lookup result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lookup"
                }
              }
            }
          },
          "400": {
            "description": "Missing or too-short part number"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "Temporarily unavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Lookup": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "normalized": {
            "type": "string"
          },
          "result": {
            "type": "string",
            "enum": [
              "verified_alternatives",
              "identity_only",
              "not_found"
            ]
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Part"
            }
          },
          "suggestions": {
            "type": "array",
            "description": "Different part numbers that begin with the query; not matches.",
            "items": {
              "type": "object"
            }
          },
          "notice": {
            "type": "string"
          },
          "documentation": {
            "type": "string"
          },
          "terms": {
            "type": "string"
          }
        }
      },
      "Part": {
        "type": "object",
        "properties": {
          "manufacturer": {
            "type": "string"
          },
          "part_number": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "identity_source": {
            "type": [
              "object",
              "null"
            ]
          },
          "relationships": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Relationship"
            }
          },
          "sellers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "seller": {
                  "type": "string"
                },
                "product_page_via": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Relationship": {
        "type": "object",
        "properties": {
          "relationship": {
            "type": "string",
            "enum": [
              "superseded_by",
              "supersedes",
              "replaced_by",
              "replaces",
              "aftermarket_replacement",
              "is_aftermarket_replacement_for",
              "conversion_kit_replacement",
              "is_conversion_kit_for",
              "same_standard_designation"
            ]
          },
          "relationship_text": {
            "type": "string"
          },
          "trust": {
            "type": "string",
            "enum": [
              "verified",
              "seller_stated"
            ]
          },
          "tier": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "part_number": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "object",
            "properties": {
              "publisher": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "pdf_page": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "printed_page": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "publicly_linked": {
                "type": "boolean"
              },
              "printed_statement": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "restrictions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "interchange": {
            "type": [
              "string",
              "null"
            ]
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}
