{"id":29890081,"url":"https://github.com/johnpatek/newsapi-go","last_synced_at":"2025-07-31T22:24:01.247Z","repository":{"id":224100479,"uuid":"761575372","full_name":"johnpatek/newsapi-go","owner":"johnpatek","description":"Golang client for News API","archived":false,"fork":false,"pushed_at":"2024-02-24T16:00:26.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T14:30:16.033Z","etag":null,"topics":["news","newsapi","rest","rest-api"],"latest_commit_sha":null,"homepage":"","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/johnpatek.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":"2024-02-22T04:51:01.000Z","updated_at":"2024-02-23T19:40:28.000Z","dependencies_parsed_at":"2024-06-21T13:24:31.160Z","dependency_job_id":null,"html_url":"https://github.com/johnpatek/newsapi-go","commit_stats":null,"previous_names":["johnpatek/newsapi-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/johnpatek/newsapi-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpatek%2Fnewsapi-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpatek%2Fnewsapi-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpatek%2Fnewsapi-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpatek%2Fnewsapi-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnpatek","download_url":"https://codeload.github.com/johnpatek/newsapi-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpatek%2Fnewsapi-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268126617,"owners_count":24200292,"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-07-31T02:00:08.723Z","response_time":66,"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":["news","newsapi","rest","rest-api"],"created_at":"2025-07-31T22:23:58.156Z","updated_at":"2025-07-31T22:24:01.234Z","avatar_url":"https://github.com/johnpatek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NewsAPI Go Client\n\n[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](http://pkg.go.dev/github.com/johnpatek/newsapi-go)\n[![codecov](https://codecov.io/gh/johnpatek/newsapi-go/branch/master/graph/badge.svg)](https://codecov.io/gh/johnpatek/newsapi-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/johnpatek/newsapi-go)](https://goreportcard.com/report/github.com/johnpatek/newsapi-go)\n\nGo client package for [NewsAPI](https://newsapi.org).\n\n## Usage\n\nThe following [example](_example/main.go) demonstrates basic usage.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/johnpatek/newsapi-go\"\n\t\"github.com/kr/pretty\"\n)\n\nfunc main() {\n\tif len(os.Args) \u003e 1 {\n\t\t// get the top headlines about Lionel Messi from US based outlets\n\t\tmessiHeadlines, err := newsapi.GetTopHeadlines(os.Args[1], newsapi.TopHeadlinesParameters{\n\t\t\tQ:        \"messi\",\n\t\t\tCategory: newsapi.Sports,\n\t\t\tCountry:  newsapi.USA,\n\t\t})\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\t// print the top articles as a formatted JSON\n\t\tfor _, headline := range messiHeadlines.Articles {\n\t\t\tpretty.Println(headline)\n\t\t}\n\t} else {\n\t\tfmt.Printf(\"Usage: example \u003cAPI KEY\u003e\")\n\t}\n}\n```\n\nThis example can be built and run using the following commands:\n```bash\nmake build\n./bin/example \u003cyour API key\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnpatek%2Fnewsapi-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnpatek%2Fnewsapi-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnpatek%2Fnewsapi-go/lists"}