I have a CSV file containing multiple Twitter URLs that I want to import into Notion as embedded tweets. The CSV structure looks like this:
tweet_url
https://twitter.com/TechCrunch/status/1234567890123456789
https://twitter.com/verge/status/9876543210987654321
https://twitter.com/engadget/status/5555444433332222111
My goal is to automatically create a Notion page where each Twitter URL becomes an embedded tweet block (similar to using the /tweet command manually).
I tried using an unofficial library called notion-py but ran into issues with the quickstart example throwing HTTPError: Invalid input errors.
Is this something I can achieve with the official Notion API? I’m not very experienced with JavaScript or API integrations, so any guidance or code examples would be really helpful. If there’s a better approach than using the Notion API, I’m open to suggestions.
I’ve been using Notion API for months and hit the same Twitter embed issues. The API supports embed blocks, but Twitter blocks most automated embedding because of their TOS changes. Here’s what works: use Zapier or Make.com as middlemen. They’ve got built-in Notion integrations that handle CSV imports way better than direct API calls. Just upload your CSV to Google Sheets, then automate it to read each row and create Notion pages with the Twitter URLs. If you’re coding this yourself, try bookmark blocks instead of embeds. You won’t get the full tweet preview, but you’ll get clean clickable links that open Twitter in a new tab. Way more reliable than fighting embed restrictions, and you can batch your whole CSV in one script.
The Notion API can create embed blocks, but Twitter URLs are tricky. When you send a Twitter link, Notion just makes a boring bookmark block instead of a proper tweet embed. Found this out the hard way on a project last year.
What works: use Twitter’s API to grab the tweet data first, then build rich text blocks in Notion with the content, author info, and a link back to the original. Not as pretty as native embeds, but it works programmatically.
For your CSV import, you’ll loop through each URL, pull the tweet ID from the URL, fetch the data via Twitter API v2, then format it into Notion blocks using their JavaScript SDK. You’ll need auth for both APIs, which is a pain but way more reliable than sketchy third-party libraries.
honestly, just create a regular database in notion and paste twitter links as url properties. notion auto-generates previews for most social media links, including twitter. it’s not as fancy as proper embeds, but you’ll avoid api headaches and rate limits.