A Python wrapper on Product Hunt API
Project description
producthunt.py
Product Hunt API wrapper for python
Installation
pip install producthunt
init
First, initialize the ProductHunt class with your API key.
from producthunt import ProductHunt
api_key = 'YOUR_API_KEY_HERE'
ph = ProductHunt(api_key)
Get Daily Products
Fetch daily new products.
daily_products = ph.get_daily()
for product in daily_products:
print(f"ID: {product['ID']}")
print(f"Name: {product['Name']}")
print(f"Tagline: {product['Tagline']}")
Get Product Details
Fetch the details of a specific product using its slug.
product_details = ph.get_product_details("some-product-slug")
if product_details:
print(f"Name: {product_details['Name']}")
print(f"Tagline: {product_details['Tagline']}")
print(f"Description: {product_details['Description']}")
print(f"Website: {product_details['Website']}")
else:
print("Product not found.")
Get Posts by Topic
Fetch posts by topic:
products = ph.get_posts_by_topic('artificial-intelligence')
for product in products:
print(f"ID: {product['ID']}")
print(f"Name: {product['Name']}")
print(f"Tagline: {product['Tagline']}")
License
This project is licensed under the terms of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
producthunt-0.1.4.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for producthunt-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e71f3e3ef9ea49575ef755f021654b6a05eb1aca86c1aeb0409a2d276979a45 |
|
MD5 | 3c03d16f07092654ce56deffe85838ec |
|
BLAKE2b-256 | 8aaf09eeee3a6576b8a41253fc2d191080b998485d5bed15112b16018d02492d |