{
  "openapi": "3.1.0",
  "info": {
    "title": "RentThis API",
    "version": "1.0.0",
    "description": "Read-only, sourced answers to renting decisions (moving trucks, storage), starting with Los Angeles. Every figure carries its source and checked date. Show the attribution link when you cite a guide. Links flagged sponsored may earn RentThis a commission.",
    "termsOfService": "https://www.rentth.is/developers/terms",
    "contact": {
      "name": "RentThis",
      "url": "https://www.rentth.is/developers"
    }
  },
  "servers": [
    {
      "url": "https://www.rentth.is/api/v1"
    }
  ],
  "paths": {
    "/categories": {
      "get": {
        "operationId": "listCategories",
        "summary": "What RentThis covers",
        "responses": {
          "200": {
            "description": "Categories"
          }
        }
      }
    },
    "/guides": {
      "get": {
        "operationId": "listGuides",
        "summary": "List published hubs and guides",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "storage"
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "los-angeles"
          }
        ],
        "responses": {
          "200": {
            "description": "Guides",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "moving-trucks/los-angeles"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "hub",
                              "guide"
                            ]
                          },
                          "category": {
                            "type": "string",
                            "example": "moving-trucks"
                          },
                          "city": {
                            "type": "string",
                            "example": "los-angeles"
                          },
                          "title": {
                            "type": "string"
                          },
                          "answer": {
                            "type": "string",
                            "description": "40–60 word direct answer, safe to quote with attribution."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "api": {
                            "type": "string",
                            "format": "uri"
                          },
                          "updated": {
                            "type": "string",
                            "format": "date"
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/guides/{category}/{city}": {
      "get": {
        "operationId": "getHub",
        "summary": "A category hub for one city, in full",
        "parameters": [
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "moving-trucks"
          },
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "los-angeles"
          }
        ],
        "responses": {
          "200": {
            "description": "Hub with sections, FAQ, sources, whereToRent, attribution"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/guides/{category}/{city}/{guide}": {
      "get": {
        "operationId": "getGuide",
        "summary": "One guide, in full",
        "parameters": [
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "guide",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Guide"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/partners": {
      "get": {
        "operationId": "listPartners",
        "summary": "Companies RentThis links to",
        "responses": {
          "200": {
            "description": "Partners",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "offer": {
                            "type": "string"
                          },
                          "link": {
                            "type": "string",
                            "format": "uri",
                            "description": "Attributed RentThis link to the company."
                          },
                          "sponsored": {
                            "type": "boolean",
                            "description": "True when the link may earn RentThis a commission. Disclose it."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "search",
        "summary": "Search guides",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "example": "storage unit"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching guides"
          },
          "400": {
            "description": "Missing query",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (60/min per IP)",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Service status",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}