https://github.com/dariubs/go-producthunt
Product Hunt API Wrapper for Golang
https://github.com/dariubs/go-producthunt
producthunt producthunt-api
Last synced: about 2 months ago
JSON representation
Product Hunt API Wrapper for Golang
- Host: GitHub
- URL: https://github.com/dariubs/go-producthunt
- Owner: dariubs
- License: mit
- Created: 2025-02-21T09:32:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-23T03:13:29.000Z (over 1 year ago)
- Last Synced: 2025-03-05T02:35:37.106Z (over 1 year ago)
- Topics: producthunt, producthunt-api
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
# go-producthunt
`go-producthunt` is a Golang package for interacting with the Product Hunt GraphQL API, offering features like retrieving daily posts, product details, topic-based listings, and top-ranked products by date with strong error handling.
## Installation
To incorporate `go-producthunt` into your project, use the following command:
```bash
go get github.com/dariubs/go-producthunt
```
Ensure your Go environment is properly configured to use modules.
## Usage
Below is a basic example demonstrating how to use the package:
```go
package main
import (
"fmt"
"log"
"github.com/dariubs/go-producthunt"
)
func main() {
// Initialize the ProductHunt client with your API key.
apiKey := "YOUR_API_KEY_HERE"
client := producthunt.ProductHunt{APIKey: apiKey}
// Retrieve the latest daily posts.
products, err := client.GetDaily()
if err != nil {
log.Fatalf("Error fetching daily posts: %v", err)
}
// Display retrieved products.
for _, product := range products {
fmt.Printf("ID: %s, Name: %s, Tagline: %s\n", product.ID, product.Name, product.Tagline)
}
}
```
Replace `"YOUR_API_KEY_HERE"` with your actual Product Hunt API key. This initializes the client and retrieves daily posts.
## Contributing
Contributions are welcome! Submit issues and pull requests via the [GitHub repository](https://github.com/dariubs/go-producthunt). Please follow coding conventions and include relevant tests and documentation with your contributions.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.