{"id":15025285,"url":"https://github.com/adamale/nbpfetch","last_synced_at":"2025-04-09T20:02:26.991Z","repository":{"id":56940359,"uuid":"199274909","full_name":"adamale/NBPFetch","owner":"adamale","description":"PHP library that helps to fetch data from NBP API. ","archived":false,"fork":false,"pushed_at":"2019-09-08T09:03:01.000Z","size":168,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-23T17:33:41.166Z","etag":null,"topics":["api-client","composer","currency-exchange-rates","currency-rates","exchange-rates","gold-price","mit","nbp","nbp-api","php","php-7","php-library","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/adamale.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}},"created_at":"2019-07-28T10:47:16.000Z","updated_at":"2022-05-20T15:02:04.000Z","dependencies_parsed_at":"2022-08-21T01:40:25.407Z","dependency_job_id":null,"html_url":"https://github.com/adamale/NBPFetch","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamale%2FNBPFetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamale%2FNBPFetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamale%2FNBPFetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamale%2FNBPFetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamale","download_url":"https://codeload.github.com/adamale/NBPFetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239044477,"owners_count":19572682,"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","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":["api-client","composer","currency-exchange-rates","currency-rates","exchange-rates","gold-price","mit","nbp","nbp-api","php","php-7","php-library","travis-ci"],"created_at":"2024-09-24T20:01:58.950Z","updated_at":"2025-02-15T19:31:11.925Z","avatar_url":"https://github.com/adamale.png","language":"PHP","readme":"# NBPFetch [![Build Status](https://travis-ci.org/adamale/NBPFetch.svg?branch=master)](https://travis-ci.org/adamale/NBPFetch)\nPHP library that helps to fetch data from NBP API - http://api.nbp.pl/en.html.  \nIt allows you to fetch currency rates, exchange rate tables and gold prices.\n\n## Requirements\nPHP 7.2 or above.\n\n## Installation\na) with Composer:\n``` bash\ncomposer require adamale/nbpfetch\n```\nb) without Composer:  \ninclude [Composer File Loader](https://github.com/Wilkins/composer-file-loader) in your project to autoload all the necessary classes.\n\n## Usage\n\n### Currency rate\n```php\n\u003c?php\n\nuse NBPFetch\\NBPFetch;\n\nrequire_once \"vendor/autoload.php\";\n\n$NBPFetch = new NBPFetch();\n$NBPFetchCurrencyRate = $NBPFetch-\u003ecurrencyRate();\n\n/**\n * Currency rate examples.\n * Available methods are: current(string $currency), today(string $currency)\n * byDate(string $currency, string $date), byDateRange(string $currency, string $from, string $to)\n * and last(string $currency, int count).\n */\ntry {\n    $currentCurrencyRate = $NBPFetchCurrencyRate-\u003ecurrent(\"EUR\");\n    $todayCurrencyRate = $NBPFetchCurrencyRate-\u003ecurrent(\"EUR\");\n    $givenDateCurrencyRate = $NBPFetchCurrencyRate-\u003ebyDate(\"EUR\", \"2019-08-28\");\n    $givenDateRangeCurrencyRates = $NBPFetchCurrencyRate-\u003ebyDateRange(\"EUR\", \"2019-08-01\", \"2019-08-31\");\n    $last10CurrencyRates = $NBPFetchCurrencyRate-\u003elast(\"EUR\", 10);\n} catch (Exception $e) {\n}\n```\n\n### Exchange rate table\n```php\n\u003c?php\n\nuse NBPFetch\\NBPFetch;\n\nrequire_once \"vendor/autoload.php\";\n\n$NBPFetch = new NBPFetch();\n$NBPFetchExchangeRateTable = $NBPFetch-\u003eexchangeRateTable();\n\n/**\n * Exchange rate table examples.\n * Available methods are: current(string $table), today(string $table),\n * byDate(string $table, string $date), byDateRange(string $table, string $from, string $to)\n * and last(string $table, int count)\n */\ntry {\n    $currentExchangeRateTable = $NBPFetchExchangeRateTable-\u003ecurrent(\"A\");\n    $todayExchangeRateTable = $NBPFetchExchangeRateTable-\u003etoday(\"A\");\n    $givenDateExchangeRateTable = $NBPFetchExchangeRateTable-\u003ebyDate(\"A\", \"2019-08-28\");\n    $givenDateRangeExchangeRateTables = $NBPFetchExchangeRateTable-\u003ebyDateRange(\"A\", \"2019-08-01\", \"2019-08-31\");\n    $last10ExchangeRateTables = $NBPFetchExchangeRateTable-\u003elast(\"A\", 10);\n} catch (Exception $e) {\n}\n```\n\n### Gold price\n```php\n\u003c?php\n\nuse NBPFetch\\NBPFetch;\n\nrequire_once \"vendor/autoload.php\";\n\n$NBPFetch = new NBPFetch();\n$NBPFetchGoldPrice = $NBPFetch-\u003egoldPrice();\n\n/**\n * Gold price examples.\n * Available methods are: current(), today(), byDate(string $date),\n * byDateRange(string $from, string $to) and last(int count)\n */\ntry {\n    $currentGoldPrice = $NBPFetchGoldPrice-\u003ecurrent();\n    $todayGoldPrice = $NBPFetchGoldPrice-\u003etoday();\n    $givenDateGoldPrice = $NBPFetchGoldPrice-\u003ebyDate(\"2019-08-28\");\n    $givenDateRangeGoldPrices = $NBPFetchGoldPrice-\u003ebyDateRange(\"2019-08-01\", \"2019-08-31\");\n    $last10GoldPrices = $NBPFetchGoldPrice-\u003elast(10);\n} catch (Exception $e) {\n}\n```\n\n## About\n\n### Author\nAdam Aleksak \u003ckontakt@adamaleksak.pl\u003e\n\n### License\nNBPFetch is licensed under the MIT License - see the `LICENSE` file for the details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamale%2Fnbpfetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamale%2Fnbpfetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamale%2Fnbpfetch/lists"}