{
  "openapi": "3.1.0",
  "info": {
    "title": "Valutakurs.nu API",
    "version": "1",
    "summary": "Riksbankens dagliga valutakurser mot SEK, med genomsnitt beräknade av Valutakurs.nu.",
    "description": "Öppet, utan nyckel. Svaren är cachade; upprepa inte samma anrop tätare än cachetiden. Attribution: Källa: Sveriges riksbank (dagliga observationer). Beräkningar: Valutakurs.nu, metodversion 1."
  },
  "externalDocs": {
    "url": "https://valutakurs.nu/api/",
    "description": "Dokumentation på svenska"
  },
  "servers": [
    {
      "url": "https://valutakurs.nu/api/v1"
    }
  ],
  "paths": {
    "/latest.json": {
      "get": {
        "summary": "Senaste kurs för alla valutor",
        "responses": {
          "200": {
            "description": "Senaste observation per valuta, var och en med sitt date_used.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "Sveriges riksbank"
                    },
                    "dataset_version": {
                      "type": "integer",
                      "description": "Publicerad datasetversion som svaret bygger på."
                    },
                    "date_used": {
                      "type": "string",
                      "format": "date",
                      "description": "Datum för den observation som faktiskt används."
                    },
                    "unit": {
                      "type": "string"
                    },
                    "rates": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "number"
                          },
                          "date_used": {
                            "type": "string",
                            "format": "date",
                            "description": "Datum för den observation som faktiskt används."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/meta.json": {
      "get": {
        "summary": "Serier, enheter, historikens start och versioner",
        "responses": {
          "200": {
            "description": "Metadata.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "Sveriges riksbank"
                    },
                    "dataset_version": {
                      "type": "integer",
                      "description": "Publicerad datasetversion som svaret bygger på."
                    },
                    "date_used": {
                      "type": "string",
                      "format": "date",
                      "description": "Datum för den observation som faktiskt används."
                    },
                    "method_version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/{cur}/{date}.json": {
      "get": {
        "summary": "Kursen för ett datum",
        "parameters": [
          {
            "name": "cur",
            "in": "path",
            "required": true,
            "description": "Valutakod med små bokstäver.",
            "schema": {
              "type": "string",
              "enum": [
                "eur",
                "usd",
                "gbp",
                "nok",
                "dkk",
                "chf",
                "pln",
                "thb",
                "try",
                "aud",
                "brl",
                "cad",
                "cny",
                "czk",
                "hkd",
                "huf",
                "idr",
                "ils",
                "inr",
                "isk",
                "jpy",
                "krw",
                "mxn",
                "myr",
                "nzd",
                "php",
                "ron",
                "sgd",
                "zar"
              ]
            }
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "description": "Datum, ÅÅÅÅ-MM-DD. Saknas kurs det datumet svarar API:et med närmast föregående bankdag, se date_used.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "En observation.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "Sveriges riksbank"
                    },
                    "dataset_version": {
                      "type": "integer",
                      "description": "Publicerad datasetversion som svaret bygger på."
                    },
                    "date_used": {
                      "type": "string",
                      "format": "date",
                      "description": "Datum för den observation som faktiskt används."
                    },
                    "currency": {
                      "type": "string"
                    },
                    "requested_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "value": {
                      "type": "number",
                      "description": "SEK per 1 enhet, exakt som Riksbanken publicerade den."
                    },
                    "unit": {
                      "type": "string"
                    },
                    "revision": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/{cur}/{date}.txt": {
      "get": {
        "summary": "Bara talet för ett datum",
        "parameters": [
          {
            "name": "cur",
            "in": "path",
            "required": true,
            "description": "Valutakod med små bokstäver.",
            "schema": {
              "type": "string",
              "enum": [
                "eur",
                "usd",
                "gbp",
                "nok",
                "dkk",
                "chf",
                "pln",
                "thb",
                "try",
                "aud",
                "brl",
                "cad",
                "cny",
                "czk",
                "hkd",
                "huf",
                "idr",
                "ils",
                "inr",
                "isk",
                "jpy",
                "krw",
                "mxn",
                "myr",
                "nzd",
                "php",
                "ron",
                "sgd",
                "zar"
              ]
            }
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "description": "Datum, ÅÅÅÅ-MM-DD. Saknas kurs det datumet svarar API:et med närmast föregående bankdag, se date_used.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Kursen som text med punkt som decimaltecken. Datumet som används står i X-Date-Used.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/{cur}/{year}.json": {
      "get": {
        "summary": "Ett års dagliga kurser och genomsnitt",
        "parameters": [
          {
            "name": "cur",
            "in": "path",
            "required": true,
            "description": "Valutakod med små bokstäver.",
            "schema": {
              "type": "string",
              "enum": [
                "eur",
                "usd",
                "gbp",
                "nok",
                "dkk",
                "chf",
                "pln",
                "thb",
                "try",
                "aud",
                "brl",
                "cad",
                "cny",
                "czk",
                "hkd",
                "huf",
                "idr",
                "ils",
                "inr",
                "isk",
                "jpy",
                "krw",
                "mxn",
                "myr",
                "nzd",
                "php",
                "ron",
                "sgd",
                "zar"
              ]
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dagliga observationer, månads- och årsgenomsnitt.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "Sveriges riksbank"
                    },
                    "dataset_version": {
                      "type": "integer",
                      "description": "Publicerad datasetversion som svaret bygger på."
                    },
                    "date_used": {
                      "type": "string",
                      "format": "date",
                      "description": "Datum för den observation som faktiskt används."
                    },
                    "currency": {
                      "type": "string"
                    },
                    "year": {
                      "type": "string"
                    },
                    "complete": {
                      "type": "boolean",
                      "description": "false för innevarande år."
                    },
                    "computed_by": {
                      "type": "string"
                    },
                    "method_version": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string"
                    },
                    "riksbanken_annual_average": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Riksbankens publicerade årsgenomsnitt, null för innevarande år."
                    },
                    "observations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "value": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "aggregates": {
                      "type": "object",
                      "properties": {
                        "year": {
                          "type": "object",
                          "properties": {
                            "period_type": {
                              "type": "string",
                              "enum": [
                                "month",
                                "year",
                                "ytd"
                              ]
                            },
                            "period": {
                              "type": "string"
                            },
                            "avg": {
                              "type": "number"
                            },
                            "high": {
                              "type": "number"
                            },
                            "high_date": {
                              "type": "string",
                              "format": "date"
                            },
                            "low": {
                              "type": "number"
                            },
                            "low_date": {
                              "type": "string",
                              "format": "date"
                            },
                            "count": {
                              "type": "integer"
                            },
                            "last_date": {
                              "type": "string",
                              "format": "date"
                            }
                          }
                        },
                        "months": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "period_type": {
                                "type": "string",
                                "enum": [
                                  "month",
                                  "year",
                                  "ytd"
                                ]
                              },
                              "period": {
                                "type": "string"
                              },
                              "avg": {
                                "type": "number"
                              },
                              "high": {
                                "type": "number"
                              },
                              "high_date": {
                                "type": "string",
                                "format": "date"
                              },
                              "low": {
                                "type": "number"
                              },
                              "low_date": {
                                "type": "string",
                                "format": "date"
                              },
                              "count": {
                                "type": "integer"
                              },
                              "last_date": {
                                "type": "string",
                                "format": "date"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/{cur}/{year}.csv": {
      "get": {
        "summary": "Ett års dagliga kurser som CSV",
        "parameters": [
          {
            "name": "cur",
            "in": "path",
            "required": true,
            "description": "Valutakod med små bokstäver.",
            "schema": {
              "type": "string",
              "enum": [
                "eur",
                "usd",
                "gbp",
                "nok",
                "dkk",
                "chf",
                "pln",
                "thb",
                "try",
                "aud",
                "brl",
                "cad",
                "cny",
                "czk",
                "hkd",
                "huf",
                "idr",
                "ils",
                "inr",
                "isk",
                "jpy",
                "krw",
                "mxn",
                "myr",
                "nzd",
                "php",
                "ron",
                "sgd",
                "zar"
              ]
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "sv ger semikolon och decimalkomma för svenskt Excel.",
            "schema": {
              "type": "string",
              "enum": [
                "sv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rad 1 är rubriker: date, currency, sek_per_unit, source, dataset_version, method_version (med locale=sv: datum, valuta, kurs_sek_per_enhet, kalla, datasetversion, metodversion).",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/{cur}/{year}.xlsx": {
      "get": {
        "summary": "Ett år som Excel-fil",
        "description": "Blad för dagliga kurser, månadsgenomsnitt och källa. Byggs när datan publiceras.",
        "parameters": [
          {
            "name": "cur",
            "in": "path",
            "required": true,
            "description": "Valutakod med små bokstäver.",
            "schema": {
              "type": "string",
              "enum": [
                "eur",
                "usd",
                "gbp",
                "nok",
                "dkk",
                "chf",
                "pln",
                "thb",
                "try",
                "aud",
                "brl",
                "cad",
                "cny",
                "czk",
                "hkd",
                "huf",
                "idr",
                "ils",
                "inr",
                "isk",
                "jpy",
                "krw",
                "mxn",
                "myr",
                "nzd",
                "php",
                "ron",
                "sgd",
                "zar"
              ]
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Excel-fil.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/averages/{year}.json": {
      "get": {
        "summary": "Års- och månadsgenomsnitt för alla valutor",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per valuta: Riksbankens publicerade årsgenomsnitt och våra beräknade genomsnitt.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "Sveriges riksbank"
                    },
                    "dataset_version": {
                      "type": "integer",
                      "description": "Publicerad datasetversion som svaret bygger på."
                    },
                    "date_used": {
                      "type": "string",
                      "format": "date",
                      "description": "Datum för den observation som faktiskt används."
                    },
                    "year": {
                      "type": "string"
                    },
                    "computed_by": {
                      "type": "string"
                    },
                    "method_version": {
                      "type": "string"
                    },
                    "attribution": {
                      "type": "string"
                    },
                    "currencies": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "riksbanken_annual_average": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "year": {
                            "type": "object",
                            "properties": {
                              "period_type": {
                                "type": "string",
                                "enum": [
                                  "month",
                                  "year",
                                  "ytd"
                                ]
                              },
                              "period": {
                                "type": "string"
                              },
                              "avg": {
                                "type": "number"
                              },
                              "high": {
                                "type": "number"
                              },
                              "high_date": {
                                "type": "string",
                                "format": "date"
                              },
                              "low": {
                                "type": "number"
                              },
                              "low_date": {
                                "type": "string",
                                "format": "date"
                              },
                              "count": {
                                "type": "integer"
                              },
                              "last_date": {
                                "type": "string",
                                "format": "date"
                              }
                            }
                          },
                          "months": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "period_type": {
                                  "type": "string",
                                  "enum": [
                                    "month",
                                    "year",
                                    "ytd"
                                  ]
                                },
                                "period": {
                                  "type": "string"
                                },
                                "avg": {
                                  "type": "number"
                                },
                                "high": {
                                  "type": "number"
                                },
                                "high_date": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "low": {
                                  "type": "number"
                                },
                                "low_date": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "count": {
                                  "type": "integer"
                                },
                                "last_date": {
                                  "type": "string",
                                  "format": "date"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/kursunderlag/{cur}/{date}/{version}.json": {
      "get": {
        "summary": "Kursunderlag: en kurs låst till en datasetversion",
        "parameters": [
          {
            "name": "cur",
            "in": "path",
            "required": true,
            "description": "Valutakod med små bokstäver.",
            "schema": {
              "type": "string",
              "enum": [
                "eur",
                "usd",
                "gbp",
                "nok",
                "dkk",
                "chf",
                "pln",
                "thb",
                "try",
                "aud",
                "brl",
                "cad",
                "cny",
                "czk",
                "hkd",
                "huf",
                "idr",
                "ils",
                "inr",
                "isk",
                "jpy",
                "krw",
                "mxn",
                "myr",
                "nzd",
                "php",
                "ron",
                "sgd",
                "zar"
              ]
            }
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "description": "Datum, ÅÅÅÅ-MM-DD. Saknas kurs det datumet svarar API:et med närmast föregående bankdag, se date_used.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^v[1-9][0-9]*$"
            },
            "description": "Datasetversion med prefixet v, till exempel v412."
          }
        ],
        "responses": {
          "200": {
            "description": "Ett kursunderlag: fälten från /{cur}/{date}.json plus en hash och attribution.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "requested_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "date_used": {
                      "type": "string",
                      "format": "date"
                    },
                    "value": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "source": {
                      "type": "string"
                    },
                    "dataset_version": {
                      "type": "integer"
                    },
                    "dataset_published_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lookup_method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "citation": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string",
                      "description": "SHA-256 av den kanoniska JSON:en av fälten currency till citation."
                    },
                    "api_url": {
                      "type": "string"
                    },
                    "superseded_by": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Adress till samma sökning på senaste datasetversionen, om kursen för datumet har ändrats sedan dess (värde, revision eller kursdatum). Annars null."
                    },
                    "attribution": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/bokslutspaket/{date}/{currencies}/{version}.json": {
      "get": {
        "summary": "Bokslutspaket: kurser för flera valutor en balansdag, låsta till en datasetversion",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "description": "Datum, ÅÅÅÅ-MM-DD. Saknas kurs det datumet svarar API:et med närmast föregående bankdag, se date_used.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "currencies",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z]{3}(-[a-z]{3}){0,28}$"
            },
            "description": "En eller flera valutakoder med små bokstäver, skilda med bindestreck, i CURRENCIES-ordning, till exempel eur-usd. Fel ordning, versaler eller en dubblett svarar 404."
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^v[1-9][0-9]*$"
            },
            "description": "Datasetversion med prefixet v, till exempel v412."
          }
        ],
        "responses": {
          "200": {
            "description": "Ett bokslutspaket: kursen per valuta på balansdagen och samma dag föregående år, med en hash och attribution.",
            "headers": {
              "X-Dataset-Version": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-Date-Used": {
                "schema": {
                  "type": "string",
                  "format": "date"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "schema": {
                  "type": "string"
                },
                "description": "När datasetversionen publicerades."
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balance_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "prior_date": {
                      "type": "string",
                      "format": "date"
                    },
                    "currencies": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "source": {
                      "type": "string"
                    },
                    "dataset_version": {
                      "type": "integer"
                    },
                    "dataset_published_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lookup_method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "currency": {
                            "type": "string"
                          },
                          "date_used": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date"
                          },
                          "value": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "revision": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "evidence_url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "no_rate": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "before-start",
                              "hole",
                              null
                            ]
                          },
                          "prior_date_used": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date"
                          },
                          "prior_value": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "prior_evidence_url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "prior_no_rate": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "before-start",
                              "hole",
                              null
                            ]
                          }
                        }
                      }
                    },
                    "sha256": {
                      "type": "string",
                      "description": "SHA-256 av den kanoniska JSON:en av fälten balance_date till och med rows."
                    },
                    "api_url": {
                      "type": "string"
                    },
                    "xlsx_url": {
                      "type": "string"
                    },
                    "superseded_by": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Adress till samma paket på senaste datasetversionen, om en rads kurs, kursdatum eller revision har ändrats sedan dess. Annars null."
                    },
                    "attribution": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    },
    "/bokslutspaket/{date}/{currencies}/{version}.xlsx": {
      "get": {
        "summary": "Samma bokslutspaket som Excel, med ett arbetsblad för saldon",
        "description": "Blad Bokslut med kurser och formler, och Källa med attribution och tekniska uppgifter.",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "description": "Datum, ÅÅÅÅ-MM-DD. Saknas kurs det datumet svarar API:et med närmast föregående bankdag, se date_used.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "currencies",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z]{3}(-[a-z]{3}){0,28}$"
            },
            "description": "En eller flera valutakoder med små bokstäver, skilda med bindestreck, i CURRENCIES-ordning, till exempel eur-usd. Fel ordning, versaler eller en dubblett svarar 404."
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^v[1-9][0-9]*$"
            },
            "description": "Datasetversion med prefixet v, till exempel v412."
          }
        ],
        "responses": {
          "200": {
            "description": "Excel-fil.",
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Okänd valuta, datum före seriens start eller år utan data."
          }
        }
      }
    }
  }
}
