A serverless TypeScript function that generates Podlink URLs from podcast show names and episode titles.
- Accepts a POST request with
showNameandepisodeTitle - Searches the Apple Podcasts Search API for the show
- Fetches the podcast's RSS feed
- Finds the matching episode by title
- Generates a URL-safe base64 hash of the episode GUID
- Returns a Podlink URL in the format:
https://pod.link/<appleID>/episode/<base64-guid>
Request Body:
{
"showName": "The Daily",
"episodeTitle": "Your Episode Title Here"
}Success Response (200):
{
"podlinkUrl": "https://pod.link/1200361736/episode/Z3VpZC12YWx1ZS1oZXJl",
"podcast": {
"name": "The Daily",
"appleId": 1200361736
},
"episode": {
"title": "Your Episode Title Here",
"guid": "guid-value-here"
}
}Error Responses:
400- Missing or invalid request fields404- Podcast or episode not found405- Method not allowed (only POST is accepted)500- Internal server error
- Node.js 20+
- npm or pnpm
npm installnpm run devThe function will be available at http://localhost:3000/api/episode-link
curl -X POST http://localhost:3000/api/episode-link \
-H "Content-Type: application/json" \
-d '{"showName": "The Daily", "episodeTitle": "Some Episode Title"}'Deploy to Vercel:
npm run deployOr connect your repository to Vercel for automatic deployments.
- Runtime: Vercel Serverless Functions
- Language: TypeScript
- XML Parsing: fast-xml-parser
- APIs: Apple Podcasts Search API