This is a Next.js project bootstrapped with create-next-app
.
First, add Twitter API key:
# .env.local
TWITTER_ACCESS_TOKEN = CHANGE_THIS_WITH_TWITTER_API_KEY
Then, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
http://localhost:3000/api/tweet/[tweet_id]
Return value:
{
"id": "string",
"text": "string",
"media": [{
"type": "enum",
"height": "number",
"width": "number",
"preview_image_url": "string",
"media_key": "string",
}],
"created_at": "date",
"source": "string",
"urls": [{
"start": "number",
"display_url": "string",
"expanded_url": "string",
"url": "string",
"end": "number"
}],
"name": "string",
"username": "string",
"profile_image_url": "string",
"verified": "boolean",
"retweet_count": "number",
"reply_count": "number",
"like_count": "number"
}
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
MIT © Imanuel Pundoko