{"id":41874752,"url":"https://github.com/hoenn/go-hn","last_synced_at":"2026-01-25T12:33:24.339Z","repository":{"id":37502407,"uuid":"184813165","full_name":"hoenn/go-hn","owner":"hoenn","description":"A Go wrapper for the HackerNews API","archived":false,"fork":false,"pushed_at":"2022-06-21T16:56:47.000Z","size":49,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T09:47:48.657Z","etag":null,"topics":["api-client","go","golang","hackernews","hackernews-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/hoenn.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-05-03T19:57:07.000Z","updated_at":"2024-04-02T18:06:42.000Z","dependencies_parsed_at":"2022-08-28T16:50:13.864Z","dependency_job_id":null,"html_url":"https://github.com/hoenn/go-hn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hoenn/go-hn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenn%2Fgo-hn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenn%2Fgo-hn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenn%2Fgo-hn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenn%2Fgo-hn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoenn","download_url":"https://codeload.github.com/hoenn/go-hn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoenn%2Fgo-hn/sbom","scorecard":{"id":467371,"data":{"date":"2025-08-11","repo":{"name":"github.com/hoenn/go-hn","commit":"1276c7dfb1e025cfbac8d9761c86d6bb02a8bdad"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/hoenn/go-hn/golangci-lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/hoenn/go-hn/golangci-lint.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/golangci-lint.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T12:53:01.484Z","repository_id":37502407,"created_at":"2025-08-19T12:53:01.484Z","updated_at":"2025-08-19T12:53:01.484Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28753007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["api-client","go","golang","hackernews","hackernews-api"],"created_at":"2026-01-25T12:33:23.551Z","updated_at":"2026-01-25T12:33:24.334Z","avatar_url":"https://github.com/hoenn.png","language":"Go","readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/hoenn/go-hn)](https://goreportcard.com/report/github.com/hoenn/go-hn)\n[![Go Reference](https://pkg.go.dev/badge/github.com/hoenn/go-hn.svg)](https://pkg.go.dev/github.com/hoenn/go-hn)\n\n## go-hn\n`go` wrapper for the HackerNews Firebase API.\n\n### Getting started\n\nAdd this package to your `go` path.\n\n`go get github.com/hoenn/go-hn`\n\nthen create the client with\n\n```go\n import \"github.com/hoenn/go-hn/pkg/hnapi\"\n //...\n c := hnapi.NewHNClient()\n```\n\n### Concepts\nStories, comments, jobs, asks and polls are all \"items\". `Item` contains a superset of the properties in each subtype. Helpers like `GetComment` can help reduce Item into a more specific Comment type.\n#### Items\n##### Item\nField | Type | Description\n------|------|------------\nBy      | `string`    | The username of the story's author\nDelete | `bool` | If this item has been deleted\nDead | `bool` | If this item has been marked Dead\nID      | `int`       | This story's item id\nDescendants | `int`   | The total comment count\nKids    | `[]int`     | The ids of the story's comments, in ranked display order.\nScore   | `int`       | The story's score\nTime    | `int64`     | Creation date of the story in Unix Time\nTimestamp   | `time.Time`     | Creation date of the item\nTitle   | `string`    | The story's title\nURL     | `string`    | The URL of the story\nType    | `string`    | The type of item (\"story\")\nPoll | `int` | Associated Poll\nParts | `int` | Associated Poll Options\n\n##### Story\nField | Type | Description\n------|------|------------\nBy      | `string`    | The username of the story's author\nID      | `int`       | This story's item id\nDescendants | `int`   | The total comment count\nKids    | `[]int`     | The ids of the story's comments, in ranked display order.\nScore   | `int`       | The story's score\nTime    | `int64`     | Creation date of the story in Unix Time\nTimestamp   | `time.Time`     | Creation date of the story\nTitle   | `string`    | The story's title\nURL     | `string`    | The URL of the story\nType    | `string`    | The type of item (\"story\")\n\n##### Comment\nField | Type | Description\n------|------|------------\nBy      | `string`    | The username of the comments's author\nID      | `int`       | This comments's item id\nKids    | `[]int`     | The ids of the story's comments, in ranked display order.\nParent  | `int`       | The comment's parent (another comment or the original story)\nTime    | `int64`     | Creation date of the comment in Unix Time\nTimestamp   | `time.Time`     | Creation date of the comment\nText    | `string`    | The comment's text\nType    | `string`    | The type of item (\"comment\")\n\n##### Poll\nField | Type | Description\n------|------|------------\nBy      | `string`    | The username of the Poll's author\nID      | `int`       | This poll's item id\nDescendants | `int`   | The total comment count\nKids    | `[]int`     | The ids of the poll's comments, in ranked display order.\nScore   | `int`       | The poll's score\nTime    | `int64`     | Creation date of the poll in Unix Time\nTimestamp   | `time.Time`     | Creation date of the poll\nTitle   | `string`    | The poll's title\nURL     | `string`    | The URL of the poll\nType    | `string`    | The type of item (\"poll\")\nParts   | `[]int`     | The item ids of the poll options\n\n##### PollOpt\nField | Type | Description\n------|------|------------\nBy      | `string`    | The username of the pollopt's author\nID      | `int`       | This pollopt's item id\nPoll    | `int`       | The pollopt's parent (the poll it belongs to)\nTime    | `int64`     | Creation date of the pollopt in Unix Time\nTimestamp   | `time.Time`     | Creation date of the pollopt\nText    | `string`    | The pollopt's text\nType    | `string`    | The type of item (\"pollopt\")\n\n#### Users\nUsers are identified by case-sensitive ids. Only users that have public activity (comments or story submissions) on the site are available through the API.\n\n##### HNUser\nField | Type | Description\n------|------|------------\nAbout       | `string`    | The user's 'about' info (HTML)\nCreated     | `int64`     | Creation date of the user in Unix Time\nDelay       | `int`       | Delay in minutes between comments becoming visible after posting\nID          | `string`  | The user's unique username, case-sensitive\nKarma       | `int`       | The user's karma\nSubmitted   | `[]int`     | List of all item submissions by user\n\n\n#### Additional Functionality\n\n##### Top Stories\nThere are additional functions in the `hnapi` package for getting the \"Top\" stories by type as determined by the API itself. You can call `client.TopStoryIDs` passing one of the following `TopType`:\n```go\n// Top is for the top ~500 stories.\nTop TopType = \"topstories\"\n// New is for the new stories.\nNew TopType = \"newstories\"\n// Best is for the highest ranking stories.\nBest TopType = \"beststories\"\n// Show is for stories categorized as 'Show'.\nShow TopType = \"showstories\"\n// Job is for stories categorized as 'Jobs'.\nJob TopType = \"jobstories\"\n```\nAny of the `TopType` options will return up to ~500 item ids.\n\n##### Updates\nThe HackerNews API also exposes an endpoint to poll for updates. `client.Updates` will return a single `*Update` containing\n\nField | Type | Description\n------|------|------------\nItems | `[]int` | Items that have been recently updated\nProfiles | `[]string` | User profiles that have been recently updated\n\n### Example Usage\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/hoenn/go-hn/pkg/hnapi\"\n)\n\nfunc main() {\n    // Create client.\n    c := hnapi.NewHNClient()\n\n    // Display a specific user's karma.\n    user, err := c.User(\"someuser\")\n    if err != nil {\n        panic(err)\n    }\n    fmt.Println(user.Karma)\n\n    // Get the current max item id.\n    maxID, err := c.MaxItemID()\n    if err != nil {\n        panic(err)\n    }\n\n    // Get the details of the current max item.\n    maxItem, err := c.GetItem(maxID)\n    // ...\n\n    id := 478932 // Some comment ID.\n    comment, err := c.GetComment(id)\n    fmt.Println(comment.By)\n    // ...\n}\n```\n\n### CLI\nThe repository also contains `go-hn-cli` which may be useful. To use it:\n```\n# Navigate to the package.\ncd cmd/go-hn-cli\n\n# Create binary in directory.\ngo build\n./go-hn-cli GetItem -i 8373\n\n# Install binary to path.\ngo install\ngo-hn-cli GetItem -i 8373\n\n# Without building or installing.\ngo run main.go GetItem -i 8373\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoenn%2Fgo-hn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoenn%2Fgo-hn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoenn%2Fgo-hn/lists"}