Hướng dẫn gumroad python
Show Tracking your Gumroad sales using Python (feat. Notion API)IntroductionNotion is an incredible software that allows creators develop, publish, maintain content with little to no effort. Creator economy is the new deal. If you are a creator who sells ebooks, presets, software bundles like Notion Templates, you must’ve heard about Gumroad. Creators, like myself and many more use Gumroad on a day to day basis. Gumroad Provides [API] that allows the creator to programmatically retrieve their products and user data for analysis/ maintenance purposes. Notion also provides [API] support to read and write into the notion workspace with granular scopes w.r.t resources. So this would naturally mean, one can read gumroad product data and write them into Notion Pages/ Databases using code. I am here to present just that. 👓 My Expectations1. Open a Notion page, Process[1] Notion IntegrationIn order to provide edit capabilities on my sales dashboard, I would want to provide access token with edit scope to my updation script (here python). To get the access token (secret key), I would want to create an internal integration. The steps to create an integration for a database can be found here Steps to setup an Integration: [Referenced from Official Notion Doc] - Go to https://www.notion.com/my-integrations A user must share specific pages with an integration in order for those pages to be accessed using the API. The script must update the Database as well as the Parent Page. Therefore, we would want to give access to both. Bear in mind to give database access before parent page access Share the integration with the Notion Database Open ‘My Products’ Database as a Page & click on the `Share` button and use the selector to find your integration by its name, then click `Invite`. Your integration now has permission to read, write, and edit the new database. Ensure that this created integration is not used by any other database Share the integration with the Parent Page Open the Gumroad Sales Page & click on the `Share` button and use the selector to find your integration by its name, then click `Invite`. Your integration now has permission to read, write, and edit the new database. [2] Gumroad IntegrationTo get your gumroad product information, you need to get a gumroad account `secret token` that will be used by the python script, to pull your product data and push them to your notion database - Login to your gumroad account and visit https://app.gumroad.com/settings/advanced url in your browser
Configuring Gumroad Application
[3] Setting up Code Environment
Let’s walk you through to get it done 😄
GitHub — tnvmadhav/notion-gumroad-integration
[4] Running Code1. After updating your notion and gumroad secret tokens into the
`my_variables.yml` , we can now install the python dependencies to run the code
3. Run the following command to start python server
4. 🙌🏻 Watch your gumroad products appear / get updated one by one in 5 to 10 second time intervals!
ConclusionThis was yet another fun experiment of mine and if you liked this, do follow me on Twitter and let me know 😁. You can find the Notion Template here :- Gumroad Sales Tracker |