https://github.com/dariubs/go-producthunt
Product Hunt API Wrapper for Golang
https://github.com/dariubs/go-producthunt
producthunt producthunt-api
Last synced: 8 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 (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-21T14:15:10.000Z (8 months ago)
- Last Synced: 2025-02-21T15:25:20.850Z (8 months ago)
- Topics: producthunt, producthunt-api
- Language: Go
- Homepage:
- Size: 3.91 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 mainimport (
"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.