Skip to content
A Go API client for HackerOne (
Branch: master
Clone or download
aegarbutt Merge pull request #17 from bored-engineer/program
Add ProgramService and update related structs
Latest commit bc8cb11 Dec 13, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
_examples Add getProgram example Nov 25, 2016
h1 Merge pull request #17 from bored-engineer/program Dec 12, 2016
.gitignore Add default GitHub gitignore Aug 1, 2016
.travis.yml Only build coverage for h1 subpackage for now Aug 1, 2016
LICENSE.txt Callout structs in Aug 1, 2016

hackeroni GoDoc Build Status Coverage Status

A Go interface around


import ""

To list all reports matching a filter:

reports, _, err := client.Report.List(h1.ReportListFilter{
	Program: []string{"uber"},
if err != nil {
for _, report := range reports {
	fmt.Println("Report Title:", *report.Title)

To retrieve a specific report:

report, _, err := client.Report.Get("123456")
if err != nil {
fmt.Println("Report Title:", *report.Title)


The h1 library does not directly handle authentication. Instead, when creating a new client, you can pass a http.Client that handles authentication for you. It does provide a APIAuthTransport structure when using API Token authentication. It is used like this:

tp := h1.APIAuthTransport{
	APIIdentifier: "your-h1-api-token-identifier",
	APIToken: "big-long-api-token-from-h1",

client := h1.NewClient(tp.Client())


All requests for listing resources such as Report support pagination. Pagination options are described in the h1.ListOptions struct and passed to the list methods as an optional parameter. Pages information is available via the h1.ResponseLinks struct embedded in the h1.Response struct.

filter := h1.ReportListFilter{
	Program: []string{"uber"},
var listOpts h1.ListOptions

var allReports []h1.Report
for {
	reports, resp, err := client.Report.List(filter, &listOpts)
	if err != nil {
	allReports = append(allReports, reports...)
	if resp.Links.Next == "" {
	listOpts.Page = resp.Links.NextPageNumber()
You can’t perform that action at this time.