{"openapi":"3.0.3","info":{"title":"indextek","version":"1.0.0","description":"Economic indexes behind one stable contract. Ask by code, and get a coefficient between two dates. Multiply an amount by the coefficient to adjust it. indextek never returns amounts and knows nothing about contracts."},"paths":{"/api/v1/indexes":{"get":{"summary":"The indexes available","responses":{"200":{"description":"The catalog","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Index"}}}}}}}},"/api/v1/indexes/{code}/values":{"get":{"summary":"Values as published, oldest first","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","example":"ICL"},"description":"The index code from GET /api/v1/indexes. Codes never change."},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","example":"2026-01-01"},"description":"First date, included."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","example":"2026-04-01"},"description":"Last date, included."}],"responses":{"200":{"description":"The values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Values"}}}},"400":{"description":"invalid_request or invalid_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"unknown_index","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"source_unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/indexes/{code}/coefficient":{"get":{"summary":"The coefficient of one period","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","example":"ICL"},"description":"The index code from GET /api/v1/indexes. Codes never change."},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date","example":"2026-01-01"},"description":"Start of the period."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date","example":"2026-04-01"},"description":"End of the period. For rent periods, use the start of the next period."},{"name":"estimate","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Project what is not published yet from the last 90 days. The answer has status \"estimated\"."}],"responses":{"200":{"description":"The coefficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Period"}}}},"400":{"description":"invalid_request or invalid_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"unknown_index","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"no_data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"source_unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/indexes/{code}/coefficients":{"post":{"summary":"The coefficients of many periods in one call","description":"Use this for tables of rent periods. A period with no data has status \"no_data\" and does not fail the others.","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","example":"ICL"},"description":"The index code from GET /api/v1/indexes. Codes never change."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["periods"],"properties":{"periods":{"type":"array","maxItems":120,"items":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","format":"date","example":"2026-01-01"},"to":{"type":"string","format":"date","example":"2026-04-01"}}}},"estimate":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"One result per period, in the same order","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"periods":{"type":"array","items":{"$ref":"#/components/schemas/Period"}}}}}}},"400":{"description":"invalid_request or invalid_range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"unknown_index","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"source_unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health":{"get":{"summary":"Service status","responses":{"200":{"description":"The service is running"}}}}},"components":{"schemas":{"Index":{"type":"object","properties":{"code":{"type":"string","example":"ICL"},"name":{"type":"string"},"variableType":{"type":"string","enum":["index","monthlyRate"]},"unit":{"type":"string"},"frequency":{"type":"string","enum":["daily","monthly"]},"lastDate":{"type":"string","format":"date","nullable":true}}},"Values":{"type":"object","properties":{"code":{"type":"string"},"variableType":{"type":"string"},"unit":{"type":"string"},"values":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"value":{"type":"number"}}}}}},"Period":{"type":"object","properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"coefficient":{"type":"number","nullable":true,"example":1.08123456},"rate":{"type":"number","nullable":true,"example":0.08123456},"status":{"type":"string","enum":["actual","estimated","no_data"]},"interpolated":{"type":"boolean","description":"True when a date had no published value and its neighbours were used."}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"unknown_index"},"message":{"type":"string"},"field":{"type":"string","nullable":true}}}}}}}}