{
 "openapi": "3.1.0",
 "info": {
  "title": "Rupee Rewind data",
  "version": "2026-11-18",
  "summary": "Prices in India in 2006, 2016 and 2026, with sources, as static JSON and CSV",
  "description": "What India paid in 2006, 2016 and 2026 for 988 things, plus prices overall (CPI-IW). Each figure is the highest price recorded in its year (2026: January to 10 November 2026), with its source and date, its change in each decade, against prices overall (CPI-IW) and after inflation. Static files: no key, no rate limit beyond fair use; CORS open. Credit “Rupee Rewind (rupeerewind.com)”. 2006 fell in the UPA years; 2016 and 2026 in the NDA years. 2016 to 2026 falls entirely in the NDA government's years. 2006 to 2016 spans about eight years of UPA government (2006 to May 2014) and about two of NDA government (May 2014 to 2016). There is no 2014 figure, so change since May 2014 cannot be read from this data. Most of these prices also depend on global oil and gold prices, the exchange rate, monsoons and harvests, taxes, subsidies and state levies; the figures show what changed, not why.",
  "license": {
   "name": "CC BY 4.0",
   "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "contact": {
   "name": "Rupee Rewind",
   "url": "https://rupeerewind.com/about"
  }
 },
 "servers": [
  {
   "url": "https://rupeerewind.com"
  }
 ],
 "externalDocs": {
  "description": "How prices are chosen and checked",
  "url": "https://rupeerewind.com/about"
 },
 "paths": {
  "/api/items.json": {
   "get": {
    "operationId": "listItems",
    "summary": "Every item, compact: prices by year, changes, real changes",
    "responses": {
     "200": {
      "description": "All items",
      "headers": {
       "Access-Control-Allow-Origin": {
        "schema": {
         "type": "string"
        },
        "description": "*"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ItemList"
        }
       }
      }
     }
    }
   }
  },
  "/api/items/{id}.json": {
   "get": {
    "operationId": "getItem",
    "summary": "One item in full: each year's price, pack, date and source, the changes and workings",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Item id, as in the page address (rupeerewind.com/petrol)",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "petrol"
     }
    ],
    "responses": {
     "200": {
      "description": "One item",
      "headers": {
       "Access-Control-Allow-Origin": {
        "schema": {
         "type": "string"
        },
        "description": "*"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Item"
        }
       }
      }
     },
     "404": {
      "description": "No such item",
      "content": {
       "text/html": {}
      }
     }
    }
   }
  },
  "/api/categories.json": {
   "get": {
    "operationId": "listCategories",
    "summary": "The category pages and the items in each",
    "responses": {
     "200": {
      "description": "All categories",
      "headers": {
       "Access-Control-Allow-Origin": {
        "schema": {
         "type": "string"
        },
        "description": "*"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Categories"
        }
       }
      }
     }
    }
   }
  },
  "/api/governments.json": {
   "get": {
    "operationId": "getGovernments",
    "summary": "India's governments since 1999 on 75 measures: each term's value with its period, source and notes (the data of /upa-vs-nda)",
    "responses": {
     "200": {
      "description": "Every measure for every term",
      "headers": {
       "Access-Control-Allow-Origin": {
        "schema": {
         "type": "string"
        },
        "description": "*"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Governments"
        }
       }
      }
     }
    }
   }
  },
  "/data/rupee-rewind.csv": {
   "get": {
    "operationId": "downloadCsv",
    "summary": "Every price as CSV: one row per item and year, with its source",
    "responses": {
     "200": {
      "description": "CSV with a header row: id, name, category, unit, currency, place, basis, year, price, price_display, pack, date_of_high, year_covers, source, source_url, rule, note, page_url, license, attribution",
      "headers": {
       "Access-Control-Allow-Origin": {
        "schema": {
         "type": "string"
        },
        "description": "*"
       }
      },
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  },
  "/data/datapackage.json": {
   "get": {
    "operationId": "getDataPackage",
    "summary": "Frictionless Data Package describing the CSV",
    "responses": {
     "200": {
      "description": "Data Package",
      "headers": {
       "Access-Control-Allow-Origin": {
        "schema": {
         "type": "string"
        },
        "description": "*"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/{page}.md": {
   "get": {
    "operationId": "getPageMarkdown",
    "summary": "Any page as Markdown (index.md for the home page)",
    "parameters": [
     {
      "name": "page",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "petrol"
     }
    ],
    "responses": {
     "200": {
      "description": "The page as Markdown",
      "headers": {
       "Access-Control-Allow-Origin": {
        "schema": {
         "type": "string"
        },
        "description": "*"
       }
      },
      "content": {
       "text/markdown": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "No such item",
      "content": {
       "text/html": {}
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Licence": {
    "type": "object",
    "required": [
     "license",
     "license_url",
     "attribution"
    ],
    "properties": {
     "license": {
      "const": "CC BY 4.0"
     },
     "license_url": {
      "type": "string",
      "format": "uri"
     },
     "attribution": {
      "type": "string"
     }
    }
   },
   "Price": {
    "type": "object",
    "required": [
     "value",
     "display"
    ],
    "properties": {
     "value": {
      "type": "number"
     },
     "display": {
      "type": "string"
     },
     "pack": {
      "type": [
       "string",
       "null"
      ]
     },
     "date_of_high": {
      "type": [
       "string",
       "null"
      ],
      "description": "When the year's high was recorded, as the source gives it"
     },
     "source": {
      "type": [
       "object",
       "null"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "label": {
        "type": "string"
       },
       "url": {
        "type": "string"
       }
      }
     },
     "covers": {
      "type": "string",
      "description": "For the latest year: how far it runs (not a full year)"
     }
    }
   },
   "Change": {
    "type": "object",
    "required": [
     "from",
     "to",
     "change_pct",
     "governments"
    ],
    "properties": {
     "from": {
      "type": "string"
     },
     "to": {
      "type": "string"
     },
     "change": {
      "type": "number",
      "description": "Price change in the item's unit"
     },
     "change_display": {
      "type": "string"
     },
     "change_pct": {
      "type": "integer",
      "description": "Percent change of the price per pack"
     },
     "change_pts": {
      "type": "number",
      "description": "For a rate (format pct): the change in percentage points"
     },
     "pack": {
      "type": "object",
      "description": "Present when the pack changed size between the two years"
     },
     "per_quantity": {
      "type": "object",
      "description": "The change per 100 g (ml, tablet…) where the pack changed size"
     },
     "prices_overall_pct": {
      "type": "integer",
      "description": "Change in prices overall (CPI-IW) over the same years"
     },
     "real_change_pct": {
      "type": "integer",
      "description": "The change after inflation"
     },
     "real_change_basis": {
      "type": "string"
     },
     "governments": {
      "type": "string",
      "description": "Which governments' years the span covers, e.g. 'NDA years'"
     }
    }
   },
   "Periods": {
    "type": "object",
    "required": [
     "years",
     "governments",
     "decades",
     "note"
    ],
    "properties": {
     "years": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     },
     "governments": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "decades": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     },
     "no_data_for": {
      "type": "string"
     },
     "note": {
      "type": "string"
     }
    }
   },
   "Item": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Licence"
     },
     {
      "type": "object",
      "required": [
       "id",
       "name",
       "title",
       "url",
       "unit",
       "years",
       "prices",
       "changes",
       "periods",
       "last_updated"
      ],
      "properties": {
       "id": {
        "type": "string",
        "pattern": "^[a-z0-9-]+$"
       },
       "name": {
        "type": "string"
       },
       "title": {
        "type": "string"
       },
       "description": {
        "type": "string"
       },
       "url": {
        "type": "string",
        "format": "uri"
       },
       "markdown": {
        "type": "string",
        "format": "uri"
       },
       "json": {
        "type": "string",
        "format": "uri"
       },
       "category": {
        "type": "object"
       },
       "group": {
        "type": "object"
       },
       "unit": {
        "type": "string"
       },
       "currency": {
        "type": "string",
        "enum": [
         "INR",
         "USD"
        ]
       },
       "format": {
        "type": "string",
        "enum": [
         "rupees",
         "usd",
         "points",
         "pct"
        ]
       },
       "place": {
        "type": "string"
       },
       "basis": {
        "type": "string"
       },
       "rule": {
        "type": "string"
       },
       "note": {
        "type": "string"
       },
       "comparability": {
        "type": "string",
        "description": "What is compared across the years: pack, variant, place and source"
       },
       "history": {
        "type": "object",
        "description": "Where the item has one: every recorded price change (series 'revisions') or its figure in every year ('yearly'), each point with its date (d), value (v), display, source key (src) and note, why it changed, the same thing elsewhere (also) and the sources in full"
       },
       "years": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "prices": {
        "type": "object",
        "additionalProperties": {
         "$ref": "#/components/schemas/Price"
        }
       },
       "latest_year": {
        "type": "object"
       },
       "summary": {
        "type": "string"
       },
       "changes": {
        "type": "object",
        "description": "Keys like 2006-2016, 2016-2026 and 2006-2026",
        "additionalProperties": {
         "$ref": "#/components/schemas/Change"
        }
       },
       "pack_change": {
        "type": "object"
       },
       "versus_prices_overall": {
        "type": "string"
       },
       "prices_overall": {
        "type": "object"
       },
       "work_time": {
        "type": "object"
       },
       "one_lakh": {
        "type": "object"
       },
       "related": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "consumer_price": {
        "type": "boolean",
        "description": "Counted among the prices people pay on the decades page and the 2016 vs 2026 page"
       },
       "periods": {
        "$ref": "#/components/schemas/Periods"
       },
       "last_updated": {
        "type": "string",
        "format": "date-time"
       },
       "citation": {
        "type": "string"
       }
      }
     }
    ]
   },
   "ItemList": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Licence"
     },
     {
      "type": "object",
      "required": [
       "items",
       "count",
       "years"
      ],
      "properties": {
       "count": {
        "type": "integer"
       },
       "years": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "periods": {
        "$ref": "#/components/schemas/Periods"
       },
       "items": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "id",
          "name",
          "unit",
          "prices",
          "url"
         ],
         "properties": {
          "id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "unit": {
           "type": "string"
          },
          "place": {
           "type": "string"
          },
          "currency": {
           "type": "string"
          },
          "category": {
           "type": "string"
          },
          "prices": {
           "type": "object",
           "additionalProperties": {
            "type": "number"
           }
          },
          "packs": {
           "type": "object",
           "additionalProperties": {
            "type": "string"
           }
          },
          "change_pct": {
           "type": "object",
           "additionalProperties": {
            "type": "integer"
           },
           "description": "Like for like: per pack, or per quantity (change_per) where the pack changed size"
          },
          "change_per": {
           "type": "string"
          },
          "per_pack_change_pct": {
           "type": "object",
           "additionalProperties": {
            "type": "integer"
           }
          },
          "real_change_pct": {
           "type": "object",
           "additionalProperties": {
            "type": "integer"
           }
          },
          "note": {
           "type": "string"
          },
          "consumer_price": {
           "type": "boolean"
          },
          "url": {
           "type": "string",
           "format": "uri"
          }
         }
        }
       }
      }
     }
    ]
   },
   "Categories": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Licence"
     },
     {
      "type": "object",
      "required": [
       "categories"
      ],
      "properties": {
       "categories": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "slug",
          "name",
          "url",
          "items"
         ],
         "properties": {
          "slug": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "url": {
           "type": "string",
           "format": "uri"
          },
          "markdown": {
           "type": "string",
           "format": "uri"
          },
          "count": {
           "type": "integer"
          },
          "items": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     }
    ]
   },
   "GovValue": {
    "type": "object",
    "required": [
     "term",
     "value"
    ],
    "properties": {
     "term": {
      "type": "string",
      "enum": [
       "vajpayee",
       "upa1",
       "upa2",
       "nda1",
       "nda2",
       "nda3"
      ]
     },
     "value": {
      "type": [
       "number",
       "null"
      ],
      "description": "As verified; null where there is no value (the page says why)"
     },
     "value_text": {
      "type": [
       "string",
       "null"
      ]
     },
     "per_year": {
      "type": [
       "number",
       "null"
      ]
     },
     "period_used": {
      "type": [
       "string",
       "null"
      ]
     },
     "source_url": {
      "type": [
       "string",
       "null"
      ],
      "description": "One or more addresses, separated by ' ; '"
     },
     "source": {
      "type": [
       "string",
       "null"
      ],
      "description": "The official answer cited where no address is linked"
     },
     "source_quote": {
      "type": [
       "string",
       "null"
      ]
     },
     "note": {
      "type": [
       "string",
       "null"
      ]
     },
     "blank_reason": {
      "type": [
       "string",
       "null"
      ],
      "description": "Why there is no value, as the page says"
     }
    }
   },
   "Governments": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Licence"
     },
     {
      "type": "object",
      "required": [
       "title",
       "url",
       "terms",
       "themes",
       "metrics",
       "last_checked"
      ],
      "properties": {
       "title": {
        "type": "string"
       },
       "url": {
        "type": "string",
        "format": "uri"
       },
       "markdown": {
        "type": "string",
        "format": "uri"
       },
       "last_checked": {
        "type": "string",
        "format": "date"
       },
       "last_updated": {
        "type": "string",
        "format": "date-time"
       },
       "how_to_read": {
        "type": "string"
       },
       "rules": {
        "type": "array",
        "items": {
         "type": "string"
        }
       },
       "terms": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "id",
          "name",
          "pm",
          "start",
          "end"
         ]
        }
       },
       "themes": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "id",
          "name",
          "metrics"
         ]
        }
       },
       "metrics": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "id",
          "name",
          "theme",
          "unit",
          "basis",
          "values",
          "url"
         ],
         "properties": {
          "id": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "theme": {
           "type": "string"
          },
          "unit": {
           "type": "string"
          },
          "basis": {
           "type": "string"
          },
          "confidence": {
           "type": "string"
          },
          "url": {
           "type": "string",
           "format": "uri"
          },
          "series_note": {
           "type": "string"
          },
          "values": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/GovValue"
           }
          },
          "page": {
           "type": "object",
           "description": "How the page shows the measure: its labels, the reason for each blank, series breaks, values printed without a bar, the whole-period change and the change in each term it works out"
          },
          "second_series": {
           "type": "object",
           "description": "The measure's second series where it has one (diesel beside petrol, children beside women…), with its own values, notes and sources",
           "properties": {
            "values": {
             "type": "array",
             "items": {
              "$ref": "#/components/schemas/GovValue"
             }
            }
           }
          }
         }
        }
       },
       "method": {
        "type": "object",
        "description": "How the measures were chosen and checked, in the page's words"
       },
       "dropped": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "id",
          "name",
          "reason"
         ]
        }
       },
       "citation": {
        "type": "string"
       }
      }
     }
    ]
   }
  }
 }
}
