{"id":22092660,"url":"https://github.com/pjaskulski/nbpapi","last_synced_at":"2025-08-26T02:16:50.670Z","repository":{"id":95934566,"uuid":"316589588","full_name":"pjaskulski/nbpapi","owner":"pjaskulski","description":"Go client library for NBP (National Bank of Poland) API","archived":false,"fork":false,"pushed_at":"2023-04-13T15:52:23.000Z","size":93,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T00:27:57.202Z","etag":null,"topics":["go","golang","nbp","nbp-api"],"latest_commit_sha":null,"homepage":"https://pjaskulski.github.io/nbpapi/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pjaskulski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-27T20:00:44.000Z","updated_at":"2023-04-20T10:16:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bc76e5a-79ef-4f93-909e-b75d9540c0e8","html_url":"https://github.com/pjaskulski/nbpapi","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/pjaskulski/nbpapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjaskulski%2Fnbpapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjaskulski%2Fnbpapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjaskulski%2Fnbpapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjaskulski%2Fnbpapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjaskulski","download_url":"https://codeload.github.com/pjaskulski/nbpapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjaskulski%2Fnbpapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272160247,"owners_count":24883781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","nbp","nbp-api"],"created_at":"2024-12-01T03:10:14.396Z","updated_at":"2025-08-26T02:16:50.659Z","avatar_url":"https://github.com/pjaskulski.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nbpapi\n\n[![GitHub](https://img.shields.io/github/license/pjaskulski/nbpapi)](https://opensource.org/licenses/MIT) \n![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/pjaskulski/nbpapi?include_prereleases) \n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/pjaskulski/nbpapi) \n[![go report](https://goreportcard.com/badge/github.com/pjaskulski/kursnbp)](https://goreportcard.com/report/github.com/pjaskulski/nbpapi) \n\n\nGo client library (unofficial) for NBP (National Bank of Poland) API: [http://api.nbp.pl/en.html](http://api.nbp.pl/en.html). \n\nThe module's functions allow you to download currency rates and prices of gold from the NBP API service. Three types have been prepared, corresponding to the basic information provided by the NBP. The **NBPTable** type is used to download full currency exchange rate tables. Three types of tables A, B, and C are supported, tables A and B contain average currency prices, table C contains 'buy' and 'sell' prices. The TableRaw, TableByDate, TableLast methods allow to download the exchange rate table (or multiple tables) and save the result in internal structures of the NBPTable type. The GetTableCurrent, GetTableToday, etc. methods return the downloaded data in the form of slices of structs. Create[]...] methods return strings prepared for printing or saving to file, based on data downloaded by Table[...] methods. \nOther types work the same way: **NBPCurrency** - for downloading the rates of a particular currency, and **NBPGold** for downloading gold prices.\n\n**Disclaimer**: nbpapi client library is a private project, in no way related to the National Bank of Poland, except for the use of the NBP public API.\n\n## Module usage\n\nThe library is used in the kursNBP project: [https://github.com/pjaskulski/kursnbp](https://github.com/pjaskulski/kursnbp).\n\n## Cache\n\nOptionally you can store the results of the query in the memory of your computer. If a cache is enabled, the results are stored for 60 minutes by default, each time you call an identical query again API service it will return the results from the cache instead of querying the real NBP API server.\nFunction EnableCache turns on the caching mechanism, DisableCache turns it off (deleting the memory content).\n\n\nTo install and use:\n\n```\ngo get https://github.com/pjaskulski/nbpapi\n```\n\nTo clone the repo and invoke the tests:\n\n```bash\ngit clone https://github.com/pjaskulski/nbpapi\n\ncd nbpapi\n\nmake test\n\nmake cover\n```\n\nWarning: by default some tests use (great) [httpmock](https://github.com/jarcoal/httpmock) library, to use the real NBP API service it is necessary to set the `USEMOCK` environment variable to `'0'`\n\n## Examples:\n    \n```go\n// How to get table A of currency exchange rates published\n// on 12 Nov 2020: function TableByDate(\"2020-11-12\") fetch data, then\n// one can get data from nbpTable.Exchange structures (or\n// nbpTable.ExchangeC structures, depending of the type of\n// table of exchange rates)\nvar tableNo string\n\nclient := nbpapi.NewTable(\"A\")\nerr: = client.TableByDate(\"2020-11-12\")\nif err != nil {\n\tlog.Fatal(err)\n}\n\nfor _, item := range client.Exchange {\n\ttableNo = item.No\n\tfor _, currencyItem := range item.Rates {\n\t\tfmt.Println(tableNo, currencyItem.Code, currencyItem.Currency, currencyItem.Mid)\n\t}\n}\n```\n\nOutput:\n\n    221/A/NBP/2020 THB bat (Tajlandia) 0.1256\n    221/A/NBP/2020 USD dolar amerykański 3.7995\n    221/A/NBP/2020 AUD dolar australijski 2.7636\n    221/A/NBP/2020 HKD dolar Hongkongu 0.4901\n    221/A/NBP/2020 CAD dolar kanadyjski 2.9074\n    221/A/NBP/2020 NZD dolar nowozelandzki 2.6119\n    221/A/NBP/2020 SGD dolar singapurski 2.8171\n    221/A/NBP/2020 EUR euro 4.4868\n    221/A/NBP/2020 HUF forint (Węgry) 0.012648\n    221/A/NBP/2020 CHF frank szwajcarski 4.1573\n    [...]\n \n    \n```go\n// today's gold price: function GetPriceToday returns GoldPrice struct\n\ngold := nbpapi.NewGold()\n\nprice, err := gold.GetPriceToday()\nif err != nil {\n\tfmt.Println(err)\n} else {\n\tfmt.Println(\"Publication date: \", price.Data)\n\tfmt.Println(\"Price of 1g of gold (PLN): \", price.Price)\n}\n```\n\nOutput: \n\n    Publication date:  2020-11-27\n    Price of 1g of gold (PLN):  218.41\n\nMore examples in the \\ example folder.\n\n\n## Documentation:\n\n0. Global functions:\n    * EnableCache\n    * DisableCache\n1. **NBPTable** type - complete tables of currency exchange rates:\n    * create new: `client := NewTable(\"C\")`\n    * methods that downloading data into NBPTable type structures:\n      - TableRaw _(only raw data: json or xml)_ \n      - TableByDate _(raw data and and structures filled with data)_\n      - TableLast _(as above)_\n    * methods that return structures with tables of currency exchange rates:\n      - GetTableCurrent \n      - GetTableCCurrent \n      - GetTableToday \n      - GetTableCToday \n      - GetTableByDay \n      - GetTableCByDay\n    * methods that return data (downloaded previously by TableByDate, or TableLast methods) as text, ready to be printed or saved to a file:\n\t  - CreatePrettyOutput \n      - CreateCSVOutput\n      - CreateRawOutput\n    * other methods:\n      - SetTableType\n2. **NBPCurrency** type - particular currency exchange rates:\n    * create new: `client := NewCurrency(\"A\")`\n    * methods that downloading data into NBPCurrency type structures:\n      - CurrencyRaw _(only raw data: json or xml)_\n      - CurrencyByDate _(raw data and and structures filled with data)_\n      - CurrencyLast _(as above)_\n      - CurrencyToday _(as above)_\n    * methods that return structures with currency rates:\n      - GetRateCurrent \n      - GetRateToday\n      - GetRateByDate\n    * methods that return data (downloaded previously) as text, ready to be printed or saved to a file:\n      - CreatePrettyOutput \n      - CreateCSVOutput \n      - CreateRawOutput\n    * other methods:\n      - SetTableType\n3. **NBPGold** type - gold prices:\n    * create new: `client := NewGold()`\n    * methods that downloading data into NBPGold type structures:\n      - GoldRaw _(only raw data: json or xml)_\n      - GoldByDate _(raw data and and structures filled with data)_\n      - GoldLast _(as above)_\n    * methods that return structures with prices of gold:\n      - GetPriceToday\n      - GetPriceCurrent \n      - GetPriceByDate\n    * methods that return data (downloaded previously) as text, ready to be printed or saved to a file:\n      - CreatePrettyOutput \n      - CreateCSVOutput \n      - CreateRawOutput\n\n\nDetailed documentation:    \n\n```\npackage nbpapi // import \"github.com/pjaskulski/nbpapi\"\n\n\nVARIABLES\n\nvar (\n\tErrInvalidCurrencyCode error = errors.New(\"Invalid currency code\")\n\tErrInvalidTableType    error = errors.New(\"Invalid table type, allowed values: A, B or C\")\n)\n    errors for invalid code, table type\n\nvar CacheOn bool = false\n    CacheOn - is in-memory cache on/off\n\nvar CurrencyValuesA = []string{\"THB\", \"USD\", \"AUD\", \"HKD\", \"CAD\", \"NZD\", \"SGD\", \"EUR\", \"HUF\", \"CHF\",\n\t\"GBP\", \"UAH\", \"JPY\", \"CZK\", \"DKK\", \"ISK\", \"NOK\", \"SEK\", \"HRK\", \"RON\",\n\t\"BGN\", \"TRY\", \"ILS\", \"CLP\", \"PHP\", \"MXN\", \"ZAR\", \"BRL\", \"MYR\", \"RUB\",\n\t\"IDR\", \"INR\", \"KRW\", \"CNY\", \"XDR\"}\n    CurrencyValuesA - list of supported currencies for table type A\n\nvar CurrencyValuesB = []string{\"MGA\", \"PAB\", \"ETB\", \"AFN\", \"VES\", \"BOB\", \"CRC\", \"SVC\", \"NIO\", \"GMD\",\n\t\"MKD\", \"DZD\", \"BHD\", \"IQD\", \"JOD\", \"KWD\", \"LYD\", \"RSD\", \"TND\", \"MAD\",\n\t\"AED\", \"STN\", \"BSD\", \"BBD\", \"BZD\", \"BND\", \"FJD\", \"GYD\", \"JMD\", \"LRD\",\n\t\"NAD\", \"SRD\", \"TTD\", \"XCD\", \"SBD\", \"ZWL\", \"VND\", \"AMD\", \"CVE\", \"AWG\",\n\t\"BIF\", \"XOF\", \"XAF\", \"XPF\", \"DJF\", \"GNF\", \"KMF\", \"CDF\", \"RWF\", \"EGP\",\n\t\"GIP\", \"LBP\", \"SSP\", \"SDG\", \"SYP\", \"GHS\", \"HTG\", \"PYG\", \"ANG\", \"PGK\",\n\t\"LAK\", \"MWK\", \"ZMW\", \"AOA\", \"MMK\", \"GEL\", \"MDL\", \"ALL\", \"HNL\", \"SLL\",\n\t\"SZL\", \"LSL\", \"AZN\", \"MZN\", \"NGN\", \"ERN\", \"TWD\", \"TMT\", \"MRU\", \"TOP\",\n\t\"MOP\", \"ARS\", \"DOP\", \"COP\", \"CUP\", \"UYU\", \"BWP\", \"GTQ\", \"IRR\", \"YER\",\n\t\"QAR\", \"OMR\", \"SAR\", \"KHR\", \"BYN\", \"LKR\", \"MVR\", \"MUR\", \"NPR\", \"PKR\",\n\t\"SCR\", \"PEN\", \"KGS\", \"TJS\", \"UZS\", \"KES\", \"SOS\", \"TZS\", \"UGX\", \"BDT\",\n\t\"WST\", \"KZT\", \"MNT\", \"VUV\", \"BAM\"}\n    CurrencyValuesB - list of supported currencies for table type B\n\nvar CurrencyValuesC = []string{\"USD\", \"AUD\", \"CAD\", \"EUR\", \"HUF\", \"CHF\", \"GBP\", \"JPY\", \"CZK\", \"DKK\", \"NOK\",\n\t\"SEK\", \"XDR\"}\n    CurrencyValuesC - list of supported currencies for table type C\n\nvar Memory *cache.Cache\n    Memory - cache\n\nvar TableValues = []string{\"A\", \"B\", \"C\"}\n    TableValues - list of table types\n\n\nFUNCTIONS\n\nfunc DisableCache()\n    DisableCache func - turn off im-memory cache\n\nfunc EnableCache()\n    EnableCache func - turn on im-memory cache\n\nfunc IsValidXML(input string) bool\n    IsValidXML - func from:\n    https://stackoverflow.com/questions/53476012/how-to-validate-a-xml\n\n\nTYPES\n\ntype ExchangeTable struct {\n\tTable         string      `json:\"table\"`\n\tNo            string      `json:\"no\"`\n\tEffectiveDate string      `json:\"effectiveDate\"`\n\tRates         []rateTable `json:\"rates\"`\n}\n    ExchangeTable type\n\ntype ExchangeTableC struct {\n\tTable         string       `json:\"table\"`\n\tNo            string       `json:\"no\"`\n\tTradingDate   string       `json:\"tradingDate\"`\n\tEffectiveDate string       `json:\"effectiveDate\"`\n\tRates         []rateTableC `json:\"rates\"`\n}\n    ExchangeTableC type\n\ntype GoldRate struct {\n\tData  string  `json:\"data\"`\n\tPrice float64 `json:\"cena\"`\n}\n    GoldRate type\n\ntype NBPCurrency struct {\n\tExchange  exchangeCurrency\n\tExchangeC exchangeCurrencyC\n\tClient    *http.Client\n\t// Has unexported fields.\n}\n    NBPCurrency type\n\nfunc NewCurrency(tableType string) *NBPCurrency\n    NewCurrency - function creates new currency type\n\nfunc (c *NBPCurrency) CreateCSVOutput(lang string) string\n    CreateCSVOutput - function returns currency rates, in the form of CSV (data\n    separated by a comma), depending on the tableType field: for type A and B\n    tables a column with an average rate is printed, for type C two columns: buy\n    price and sell price\n\n    Parameters:\n\n        lang - 'en' or 'pl'\n\nfunc (c *NBPCurrency) CreatePrettyOutput(lang string) string\n    CreatePrettyOutput - function returns exchange rates as formatted table\n    depending on the tableType field: for type A and B tables a column with an\n    average rate is printed, for type C two columns: buy price and sell price\n\n    Parameters:\n\n        lang - 'en' or 'pl'\n\nfunc (c *NBPCurrency) CreateRawOutput() string\n    CreateRawOutput - function print just result of request (json or xml)\n\nfunc (c *NBPCurrency) CurrencyByDate(code, date string) error\n    CurrencyByDate - function downloads and writes data to exchange (exchangeC)\n    slice, raw data (json) still available in result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (rate for today) or 'current' - current table / rate (last published)\n\n        code - ISO 4217 currency code, depending on the type of the\n        table available currencies may vary\n\nfunc (c *NBPCurrency) CurrencyLast(code string, last int) error\n    CurrencyLast - function downloads and writes data to exchange (exchangeC)\n    slice, raw data (json) still available in result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        code - ISO 4217 currency code, depending on the type of the\n        table available currencies may vary\n\n        last - as an alternative to date, the last \u003cn\u003e tables/rates\n        can be retrieved\n\nfunc (c *NBPCurrency) CurrencyRaw(code, date string, last int, format string) error\n    CurrencyRaw - function downloads data in json or xml form\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (rate for today) or 'current' - current table / rate (last published)\n\n        last - as an alternative to date, the last \u003cn\u003e tables/rates\n        can be retrieved\n\n        code - ISO 4217 currency code, depending on the type of the\n        table available currencies may vary\n\n        format - 'json' or 'xml'\n\nfunc (c *NBPCurrency) CurrencyToday(code string) error\n    CurrencyToday - function downloads and writes data to exchange (exchangeC)\n    slice, raw data (json) still available in result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        code - ISO 4217 currency code, depending on the type of the\n        table available currencies may vary\n\nfunc (c *NBPCurrency) GetRateByDate(code, date string) ([]Rate, error)\n    GetRateByDate - function downloads today's currency exchange rate and\n    returns slice of Rate struct (or error)\n\n    Parameters:\n\n        code - ISO 4217 currency code, depending on the type of the\n        table available currencies may vary\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (rate for today) or 'current' - current table / rate (last published)\n\nfunc (c *NBPCurrency) GetRateCurrent(code string) (Rate, error)\n    GetRateCurrent - function downloads current currency exchange rate and\n    return Rate struct (or error)\n\n    Parameters:\n\n        code - ISO 4217 currency code, depending on the type of the\n        table available currencies may vary\n\nfunc (c *NBPCurrency) GetRateToday(code string) (Rate, error)\n    GetRateToday - function downloads today's currency exchange rate and returns\n    Rate struct (or error)\n\n    Parameters:\n\n        code - ISO 4217 currency code, depending on the type of the\n        table available currencies may vary\n\nfunc (c *NBPCurrency) SetTableType(tableType string) error\n    SetTableType - the function allows to set the supported type of exchange\n    rate table\n\ntype NBPGold struct {\n\tGoldRates []GoldRate\n\n\tClient *http.Client\n\t// Has unexported fields.\n}\n    NBPGold type\n\nfunc NewGold() *NBPGold\n    NewGold - function creates new gold type\n\nfunc (g *NBPGold) CreateCSVOutput(lang string) string\n    CreateCSVOutput - function returns prices of gold in CSV format (comma\n    separated data)\n\n    Parameters:\n\n        lang - 'en' or 'pl'\n\nfunc (g *NBPGold) CreatePrettyOutput(lang string) string\n    CreatePrettyOutput - function returns a formatted table of gold prices\n\n    Parameters:\n\n        lang - 'en' or 'pl'\n\nfunc (g *NBPGold) CreateRawOutput() string\n    CreateRawOutput - function returns just result of request (json or xml)\n\nfunc (g *NBPGold) GetPriceByDate(date string) ([]GoldRate, error)\n    GetPriceByDate - function returns gold prices (as slice of struct), by date\n    (\"YYYY-MM-DD\") or range of dates (\"YYYY-MM-DD:YYYY-MM-DD\")\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (price for today) or 'current' - current gold price (last published)\n\nfunc (g *NBPGold) GetPriceCurrent() (GoldRate, error)\n    GetPriceCurrent - function downloads and returns current gold price as\n    GoldRate struct\n\nfunc (g *NBPGold) GetPriceToday() (GoldRate, error)\n    GetPriceToday - function downloads and returns today's gold price, as\n    GoldRate struct\n\nfunc (g *NBPGold) GoldByDate(date string) error\n    GoldByDate - function downloads and writes data to goldRates slice, raw data\n    (json) still available in NBPGold.result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (price for today) or 'current' - current gold price (last published)\n\nfunc (g *NBPGold) GoldLast(last int) error\n    GoldLast - function downloads and writes data to GoldRates slice, raw data\n    (json) still available in NBPGold.result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        last - as an alternative to date, the last \u003cn\u003e prices of gold\n        can be retrieved\n\nfunc (g *NBPGold) GoldRaw(date string, last int, format string) error\n    GoldRaw - function downloads data in json or xml form\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (price for today) or 'current' - current gold price (last published)\n\n        last - as an alternative to date, the last \u003cn\u003e prices of gold\n        can be retrieved\n\n        format - 'json' or 'xml'\n\ntype NBPTable struct {\n\tExchange  []ExchangeTable\n\tExchangeC []ExchangeTableC\n\tClient    *http.Client\n\t// Has unexported fields.\n}\n    NBPTable type\n\nfunc NewTable(tableType string) *NBPTable\n    NewTable - function creates new table type\n\nfunc (t *NBPTable) CreateCSVOutput(lang string) string\n    CreateCSVOutput - function prints tables of exchange rates in the console,\n    in the form of CSV (data separated by a comma), depending on the tableType\n    field: for type A and B tables a column with an average rate is printed, for\n    type C two columns: buy price and sell price\n\n    Parameters:\n\n        lang - 'en' or 'pl'\n\nfunc (t *NBPTable) CreatePrettyOutput(lang string) string\n    CreatePrettyOutput - function returns tables of exchange rates as formatted\n    table, depending on the tableType field: for type A and B tables a column\n    with an average rate is printed, for type C two columns: buy price and sell\n    price\n\n    Parameters:\n\n        lang - 'en' or 'pl'\n\nfunc (t *NBPTable) CreateRawOutput() string\n    CreateRawOutput - function returns just result of request (json or xml)\n\nfunc (t *NBPTable) GetTableByDate(date string) ([]ExchangeTable, error)\n    GetTableByDate - function retrieves a table of exchange rates for a given\n    day and return slice of struct ExchangeTable (or error). Version for table\n    A, B (mid - average price)\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (rate for today) or 'current' - current table / rate (last published)\n\nfunc (t *NBPTable) GetTableCByDate(date string) ([]ExchangeTableC, error)\n    GetTableCByDate - function retrieves a table of exchange rates for a given\n    day and return slice of struct ExchangeTable (or error). Version for table C\n    (ask, bid - buy, sell prices)\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (rate for today) or 'current' - current table / rate (last published)\n\nfunc (t *NBPTable) GetTableCCurrent() ([]ExchangeTableC, error)\n    GetTableCCurrent - function downloads current table of currency exchange\n    rates and return slice of struct ExchangeTableC (or error), version for\n    table C (bid, ask - buy, sell prices)\n\nfunc (t *NBPTable) GetTableCToday() ([]ExchangeTableC, error)\n    GetTableCToday - function downloads today's table of currency exchange rates\n    and return slice of struct ExchangeTableC (or error), version for table C\n    (bid, ask - buy, sell prices)\n\nfunc (t *NBPTable) GetTableCurrent() ([]ExchangeTable, error)\n    GetTableCurrent - function downloads current table of currency exchange\n    rates and return slice of struct ExchangeTable (or error), version for table\n    A, B (mid - average price)\n\nfunc (t *NBPTable) GetTableToday() ([]ExchangeTable, error)\n    GetTableToday - function downloads today's table of currency exchange rates\n    and return slice of struct ExchangeTable (or error), version for table A, B\n    (mid - average price)\n\nfunc (t *NBPTable) SetTableType(tableType string) error\n    SetTableType - the function allows to set the supported type of exchange\n    rate table\n\nfunc (t *NBPTable) TableByDate(date string) error\n    TableByDate - function downloads and writes data to NBPTable.Exchange\n    (NBPTable.ExchangeC) slice, raw data (json) still available in\n    NBPTable.result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (rate for today) or 'current' - current table / rate (last published)\n\nfunc (t *NBPTable) TableLast(last int) error\n    TableLast - function downloads and writes data to NBPTable.Exchange\n    (NBPTable.ExchangeC) slice, raw data (json) still available in\n    NBPTable.result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        last - the last \u003cn\u003e tables/rates can be retrieved\n\nfunc (t *NBPTable) TableRaw(date string, last int, format string) error\n    TableRaw - function downloads data in json or xml form, the data will be\n    placed as [] byte in the result field\n\n\n    Function returns error or nil\n\n    Parameters:\n\n        date - date in the format: 'YYYY-MM-DD' (ISO 8601 standard),\n        or a range of dates in the format: 'YYYY-MM-DD:YYYY-MM-DD' or 'today'\n        (rate for today) or 'current' - current table / rate (last published)\n\n        last - as an alternative to date, the last \u003cn\u003e tables/rates\n        can be retrieved\n\n        format - 'json' or 'xml'\n\ntype Rate struct {\n\tNo            string\n\tEffectiveDate string\n\tMid           float64\n\tBid           float64\n\tAsk           float64\n}\n    Rate type\n\n```\n\n## TODO\n\n- [ ]  more tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjaskulski%2Fnbpapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjaskulski%2Fnbpapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjaskulski%2Fnbpapi/lists"}