Back to APIs list

Twitter API examples & templates

Use these vals as a playground to view and fork Twitter API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
friendWithGeoff
arbesman
friendWithGeoff
An interactive, runnable TypeScript val by arbesman
Script
emojiSearchBot
stevekrouse
emojiSearchBot
Remix of: andreterron/actuallyItsXBot
Cron
twitterOpenGraphImage
panphora
twitterOpenGraphImage
An interactive, runnable TypeScript val by panphora
HTTP
postEval
vladimyr
postEval
Remix of: stevekrouse/xeval
HTTP
sortedPosts
andreterron
sortedPosts
Prioritizes posts by authors with the most followers
Script
actuallyItsXBot
andreterron
actuallyItsXBot
Actually, It's 𝕏 An annoying bot that corrects people about the new name of the app previously known as Twitter. Follow it on 𝕏 ! The Twitter β†’ 𝕏 transition is pretty painful, and this bot is here to make things even worse! Want to create your own bot? Check out https://www.val.town/v/andreterron.twitter
Script
checkIfTwitterAPIIsDown
stevekrouse
checkIfTwitterAPIIsDown
// let's poll the elevated v2 twitter api
Script
friendIds
charles2
friendIds
An interactive, runnable TypeScript val by charles2
Script
myspace
jdan
myspace
Create your own Myspace profile, deployed to Val town. https://jdan-myspace.web.val.run Click "..." and select Fork to create your own. From there you can: Customize your own profile Or post on my wall by appending to messages and sending me a pull request
HTTP
myspace
stevekrouse
myspace
Remix of: jdan/myspace
HTTP
twitterAlert
Akash11
twitterAlert
Remix of: valdottown/templateTwitterAlert
Cron
twitterNewFollowingAlert
socialdata
twitterNewFollowingAlert
Twitter/𝕏 - New user following alert [TEMPLATE] SocialData Monitoring API provides an easy way to get nearly real-time notifications when any Twitter user follows someone. Use this Val template to deliver notifications to Discord or Telegram. Example Prerequisites SocialData account Set Up 1. Fork this Val To use this template, fork this Val in the top right corner of this page. 2. Update Environment Variables You don't need to change any code - this template works as-is, and only requires a few environment variables in order to deliver your notifications to Discord or Telegram. Open Val.town environment variables page and create the following variables: DISCORD_WEBHOOK_URL - required when using Discord for notifications TELEGRAM_API_TOKEN - required when using Telegram for notifications TELEGRAM_USER_ID - required when using Telegram for notifications You don't have to set up both Discord and Telegram at the same time. Either is required for this Val to work, but you may set up both at the same time. Not sure where to get these? Scroll down to FAQ section below. 3. Create Your Monitor Open SocialData monitors page and create your monitor. Use your Val URL as the webhook URL of your new monitor: 4. Wait for Your Notification That's it! When the user you are monitoring follows someone - SocialData and val.town will handle the rest and deliver your notification to Discord or Telegram. FAQs Where do I get Discord webhook URL? Follow this guide to create a Discord webhook URL. Where do I get Telegram bot API token and User ID? Follow this guide to create your own Telegram bot and obtain it's API token. Add @userinfobot and the bot will reply with your ID whenever you add it (Click Start or type /start ) Can I use the same Discord / Telegram settings for multiple monitors? Yes! You can send notifications from multiple monitors and even different monitor types using the same Discord webhook or Telegram bot token. Check out our other webhook handlers on val.town: New tweet notifications Profile update notifications New followed account notifications
HTTP
twitterRequestAccessToken
andreterron
twitterRequestAccessToken
An interactive, runnable TypeScript val by andreterron
Script
twitterProfileUpdatedAlert
socialdata
twitterProfileUpdatedAlert
Twitter/𝕏 - Twitter profile update alert [TEMPLATE] SocialData Monitoring API provides an easy way to get nearly real-time notifications when any Twitter user updates their profile. Use this Val template to deliver notifications to Discord or Telegram. Example Prerequisites SocialData account Set Up 1. Fork this Val To use this template, fork this Val in the top right corner of this page. 2. Update Environment Variables You don't need to change any code - this template works as-is, and only requires a few environment variables in order to deliver your notifications to Discord or Telegram. Open Val.town environment variables page and create the following variables: DISCORD_WEBHOOK_URL - required when using Discord for notifications TELEGRAM_API_TOKEN - required when using Telegram for notifications TELEGRAM_USER_ID - required when using Telegram for notifications You don't have to set up both Discord and Telegram at the same time. Either is required for this Val to work, but you may set up both at the same time. Not sure where to get these? Scroll down to FAQ section below. 3. Create Your Monitor Open SocialData monitors page and create your monitor. Use your Val URL as the webhook URL of your new monitor: 4. Wait for Your Notification That's it! When the user you are monitoring updates their profile - SocialData and val.town will handle the rest and deliver your notification to Discord or Telegram. FAQs Where do I get Discord webhook URL? Follow this guide to create a Discord webhook URL. Where do I get Telegram bot API token and User ID? Follow this guide to create your own Telegram bot and obtain it's API token. Add @userinfobot and the bot will reply with your ID whenever you add it (Click Start or type /start ) Can I use the same Discord / Telegram settings for multiple monitors? Yes! You can send notifications from multiple monitors and even different monitor types using the same Discord webhook or Telegram bot token. Check out our other webhook handlers on val.town: New tweet notifications Profile update notifications New followed account notifications
HTTP
X
AppleLamps
X
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
exampleTwitterSearch
stevekrouse
exampleTwitterSearch
An interactive, runnable TypeScript val by stevekrouse
Script
…
6
…
Next