{"id":37135079,"url":"https://github.com/kplachkov/btcprice","last_synced_at":"2026-01-14T15:45:32.929Z","repository":{"id":103793784,"uuid":"127961504","full_name":"kplachkov/btcprice","owner":"kplachkov","description":"Btcprice is a fast, simple and clean way to get the price of Bitcoin. The package uses the Blockchain API.","archived":false,"fork":false,"pushed_at":"2018-08-04T10:44:55.000Z","size":128,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T13:46:16.586Z","etag":null,"topics":["bitcoin","bitcoin-price","blockchain","blockchain-api","btc","golang","golang-library","price"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kplachkov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2018-04-03T19:56:30.000Z","updated_at":"2023-06-07T01:36:00.000Z","dependencies_parsed_at":"2023-07-26T03:01:15.063Z","dependency_job_id":null,"html_url":"https://github.com/kplachkov/btcprice","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kplachkov/btcprice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kplachkov%2Fbtcprice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kplachkov%2Fbtcprice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kplachkov%2Fbtcprice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kplachkov%2Fbtcprice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kplachkov","download_url":"https://codeload.github.com/kplachkov/btcprice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kplachkov%2Fbtcprice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bitcoin","bitcoin-price","blockchain","blockchain-api","btc","golang","golang-library","price"],"created_at":"2026-01-14T15:45:32.008Z","updated_at":"2026-01-14T15:45:32.919Z","avatar_url":"https://github.com/kplachkov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"image/btcprice.png\" alt=\"btcprice\"\u003e\u003c/p\u003e\n\n[![Codecov](https://img.shields.io/codecov/c/github/kplachkov/btcprice.svg?style=flat-square)](https://codecov.io/gh/kplachkov/btcprice)\n[![Build Status](https://img.shields.io/travis/kplachkov/btcprice.svg?style=flat-square)](https://travis-ci.org/kplachkov/btcprice)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kplachkov/btcprice?style=flat-square)](https://goreportcard.com/report/github.com/kplachkov/btcprice)\n[![GoDoc](https://godoc.org/github.com/kplachkov/btcprice?status.svg)](https://godoc.org/github.com/kplachkov/btcprice)\n[![GitHub release](https://img.shields.io/github/release/kplachkov/btcprice.svg?style=flat-square)](https://github.com/kplachkov/btcprice/releases)\n\n**Btcprice** is a fast, simple and clean way to get the price of Bitcoin. The package uses the Blockchain API as a source of the price. Btcprice can be used with custom source of data too.\n\n* [Installation](#installation)\n* [Getting Started](#getting-started)\n* [License](#license)\n\n\n## Installation\n\n### Install via `go get`\n\nTo install btcprice, use `go get`.\n\n```bash\n$ go get github.com/kplachkov/btcprice/\n```\n\n## Getting Started\n\n```bash\n$ godoc github.com/kplachkov/btcprice/\n```\n\n### Code Example:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/kplachkov/btcprice\"\n)\n\n// Prints the time and the price of Bitcoin.\nfunc printBtcPriceAndTime(btcPrice float64, t time.Time) {\n\tfmt.Println(t.Format(time.RFC3339))\n\tfmt.Println(\"Bitcoin price:\", btcPrice)\n}\n\n// Checks for changes in the price of Bitcoin.\nfunc checkBtcPrice(timeDuration time.Duration) {\n\tblockchain, serErr := btcprice.NewBlockchainService()\n\tif serErr != nil {\n\t\tlog.Fatal(serErr)\n\t}\n\tbtcPrice := blockchain.BitcoinPrice.Usd.Last // The latest price of Bitcoin.\n\tprintBtcPriceAndTime(btcPrice, time.Now())\n\t// Prints the time and the latest Bitcoin price if the price has changed.\n\tfor t := range time.NewTicker(timeDuration).C {\n\t\tnewBtcErr := blockchain.Update(nil)\n\t\tif newBtcErr != nil {\n\t\t\tlog.Fatal(newBtcErr)\n\t\t}\n\t\tnewBtcPrice := blockchain.BitcoinPrice.Usd.Last\n\t\t// If the price has changed, it prints the time and up to date price.\n\t\tif btcPrice != newBtcPrice {\n\t\t\tprintBtcPriceAndTime(newBtcPrice, t)\n\t\t}\n\t\tbtcPrice = newBtcPrice\n\t}\n}\n\nfunc main() {\n\tcheckBtcPrice(time.Second) // Check the price of Bitcoin every second.\n}\n\n```\n\n## License\n\nBSD 3-Clause\n\nCopyright (c) 2018-Present, kplachkov","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkplachkov%2Fbtcprice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkplachkov%2Fbtcprice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkplachkov%2Fbtcprice/lists"}