This project is a FastAPI integration for fetching sales data from Gumroad and sending updates to a Telex channel at specified intervals.
- Fetches sales data from the Gumroad API
- Sends formatted reports to a Telex channel
- Runs as an interval-based integration on Telex
- Python 3.9+
- FastAPI
- Uvicorn
requests
library
-
Clone the repository:
git clone https://github.com/your-username/hngx-stage3-Gumroad-sales-summary.git cd hngx-stage3-Gumroad-sales-summary
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
Start the FastAPI server with Uvicorn:
uvicorn app.main:app --reload
The API will be available at: http://127.0.0.1:8000
You can test the /tick
endpoint using curl
:
curl --location 'http://localhost:8000/tick' \
--header 'Content-Type: application/json' \
--data '{
"channel_id": "<your-test-telex-channel-id>",
"return_url": "https://ping.telex.im/v1/return/<your-test-telex-channel-id>",
"settings": [
{
"label": "gumroad_api_key",
"type": "text",
"required": True,
"default": GUMROAD_API_KEY"
},
{
"label": "interval",
"type": "text",
"required": true,
"default": "* * * * *"
}
]
}'
- Push the code to GitHub.
- Create a new Web Service on Render.
- Connect the repository and set the Start Command to:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
- Set up the default environment variables for the Gumroad API keys.
- Deploy and obtain the public URL for your API.