Use hypothesis.NewClient to create a hypothesis.Client that searches for annotations.
NewClient's token param is optional. If it's set to your Hypothesis token, you'll search both public and private annotations. If it's the empty string, you'll only search public annotations.
NewClient's hypothesis.SearchParams is likewise optional. If empty, your search will be unfiltered.
NewClient's maxSearchResults param determines how many annotations to fetch. If 0, the limit defaults to 400.
To search for the most recent 10 public annotations:
To search for the most recent 10 public or private annotations, if your token is in an env var called H_TOKEN:
To search for the most recent 10 annotations in a private group whose id in an env var called H_GROUP:
To search for at most 10 public or private annotations from user 'judell', with the tag 'social media':
The Hypothesis search API returns at most 200 annotations. hypothesis.Search encapsulates that API call, and returns an array of hypothesis.Row. Each Row represents one annotation. To fetch more than 200 annotations, use hypothesis.SearchAll.
This test should find 2000 recent public or private annotations.
For more search examples, see the Steampipe Hypothesis plugin.
If you authenticate with your token you can call hypothesis.Client.GetProfile to list your private groups.
Here, 'profile' is a hypothesis.Profile which includes hypothesis.Profile.Groups, an array of structs that include the names and ids of your private groups.
An annotation may include an array of hypothesis.Selector. These structures define how the annotation "anchors" to the segment it refers to. See anchoring.