# Speech to Text API: Transcribe Any Audio or Video Link (`codepulsehq/speech-to-text-api`) Actor

Turn podcast episodes, webinars, interviews and recordings into text with timestamps. Whisper-based, any file length, SRT/VTT/Markdown output. $0.004 per minute, failed files are free.

- **URL**: https://apify.com/codepulsehq/speech-to-text-api.md
- **Developed by:** [Code Pulse](https://apify.com/codepulsehq) (community)
- **Categories:** AI, Videos, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Speech to Text API: transcribe any audio or video link with Whisper, from $0.24 an hour

Paste links to audio or video files (podcast episodes, webinars, interviews, meeting recordings) and get back the **full transcript with timestamps**, plus AI-ready chunks, Markdown, SRT or WebVTT. Long files are handled for you: they are split, transcribed and stitched back together with correct timestamps. **No accounts with a speech provider, no keys to manage.**

**$0.004 per audio minute ($0.24 per hour).** Failed files are free, and an *Only estimate the cost* mode shows the price before you commit.

**Try it free:** Apify's free plan includes $5 of monthly credit, enough for about 20 hours of audio transcribed. Press **Start** at the top of this page.

### At a glance

- **What it is:** an API and no-code tool that turns audio and video files into text using Whisper.
- **Input:** direct links to media files (MP3, M4A, WAV, MP4, WebM, OGG, FLAC and most others). Up to 700 MB per file.
- **Output:** transcript text, timestamped sentences, chunks for RAG, Markdown, SRT and WebVTT, with the language detected automatically.
- **Price:** $0.004 per audio minute, billed per started minute, only for files that were transcribed.
- **How to call it:** the Apify Console, the REST API (curl, Python, JavaScript), n8n, Make, Zapier, or an AI agent through MCP.

### Does this sound like you?

| What's going wrong | What this does about it |
|---|---|
| "I have an hour-long recording and every tool wants a subscription." | Pay per minute with no subscription. An hour costs about $0.24. |
| "The speech API has a 25 MB limit and my file is bigger." | Large files are converted, split, transcribed and stitched together for you. |
| "I want to know the cost first." | Turn on **Only estimate the cost** to get each file's length and price for free. |
| "Names and jargon are misspelled." | Add them under **Names and jargon** and the transcript spells them correctly. |
| "I need subtitles or text I can feed to an AI." | SRT, WebVTT, Markdown or timestamped chunks. |

### Who uses it

- **Podcast and media teams:** transcripts for show notes, search and accessibility.
- **Researchers and journalists:** interviews and recordings to text.
- **Support and sales teams:** call and meeting recordings to searchable text.
- **AI and RAG builders:** turn audio libraries into searchable chunks with timestamps.
- **AI agents:** give an agent a "transcribe this recording" tool through MCP.

### How to use it in 3 steps

1. Click **Start**.
2. Paste the links to your audio or video files under **Links to audio or video files**. Optionally set the language and add names or jargon.
3. Open the **Output** tab and download JSON, CSV or Excel.

### What you get

```json
{
  "success": true,
  "url": "https://example.com/episode-42.mp3",
  "duration_seconds": 2710,
  "minutes_billed": 46,
  "language": "en",
  "text": "Welcome back to the show. Today we're talking about...",
  "segments": [{ "start": 0.0, "end": 3.4, "text": "Welcome back to the show." }],
  "chunks": [{ "index": 0, "start": 0.0, "end": 58.2, "text": "Welcome back to the show. ..." }]
}
```

A file that can't be transcribed comes back as `success: false` with an `error_code` (such as `download_failed`, `not_media`, `no_speech` or `too_long`) and a plain-English `error`. These rows are free.

### Input options

| Option | What it does |
|---|---|
| **Links to audio or video files** | Direct links to the files. A link to a web page won't work. |
| **Language** | Leave empty to detect it, or set `en`, `es`, `fr`, `de`... |
| **Names and jargon** | A short list of names or terms that appear in the audio. |
| **Include timestamps** | Adds `segments`. |
| **Split into chunks** | Adds `chunks` of about that size with start and end times. |
| **Extra formats** | Adds `markdown`, `srt` and/or `vtt`. |
| **Maximum minutes per file** | Skips longer files for free. |
| **Only estimate the cost** | Returns each file's length and estimated cost without transcribing. |

### Call it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/codepulsehq~speech-to-text-api/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "urls": ["https://example.com/episode-42.mp3"], "language": "en", "includeSegments": false }'
```

For files longer than about five minutes use the asynchronous run endpoint or the Python and JavaScript clients, which wait as long as needed:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("codepulsehq/speech-to-text-api").call(run_input={"urls": ["https://example.com/episode-42.mp3"], "outputFormats": ["srt"]})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row["url"], row["minutes_billed"] if row["success"] else row["error"])
```

### Use it from an AI agent (MCP)

```json
{ "mcpServers": { "speech-to-text": { "url": "https://mcp.apify.com?tools=codepulsehq/speech-to-text-api" } } }
```

### Pricing

- **$0.004 per audio minute**, rounded up to the next minute for each file (a 10 minute 20 second file is 11 minutes).
- Charged only after a file has been transcribed. Failed files, files over your minute limit and estimate-only runs cost nothing.
- Set a maximum cost per run to cap spending.

| Length | Cost |
|---|---|
| 10 minutes | $0.04 |
| 1 hour | $0.24 |
| 100 hours | $24 |

### Quick answers

**How do I transcribe a podcast episode?** Paste the direct link to the episode's MP3 file. Many podcast pages have it behind a "download" button, or in the show's RSS feed.

**Does it work with a YouTube link?** No: that's a web page, not a file. For YouTube use our [YouTube Transcript API](https://apify.com/codepulsehq/youtube-transcript-api), which reads the video's existing captions and is cheaper. Use this Actor for files that have no captions.

**How accurate is it?** It uses Whisper, which is strong on clear speech in many languages. Noisy audio, heavy accents and overlapping speakers lower accuracy. Adding names and jargon helps.

**Does it identify speakers?** Not yet. You get the text and timestamps without speaker labels.

**Is my audio kept?** Files are downloaded to a temporary folder for the run, sent to the speech service for transcription and deleted when the run finishes.

### Limits you should know

- Direct links only, up to 700 MB per file.
- No speaker labels.
- Long files are cut into 15-minute pieces, so a word at a cut can occasionally be split or repeated.
- Quality depends on the audio.

### More from CodePulse

- [YouTube Transcript API](https://apify.com/codepulsehq/youtube-transcript-api): transcripts of YouTube videos, playlists and channels from their captions.
- [Domain Intelligence API](https://apify.com/codepulsehq/domain-intelligence-api): WHOIS, DNS, SSL, email security and tech stack for any domain.

### FAQ

**Something broke or you need a feature?** Open an issue from the **Issues** tab with a link to a file that fails.

# Actor input Schema

## `urls` (type: `array`):

Direct links to the files, for example https://example.com/episode.mp3. MP3, M4A, WAV, MP4, WebM, OGG, FLAC and most other formats work. A link to a web page will not work: use the link to the file itself.

## `language` (type: `string`):

Language code such as en, es, fr or de. Leave empty to detect the language automatically. Setting it improves accuracy and speed when you know it.

## `prompt` (type: `string`):

A short list of names or specialist words that appear in the audio, for example Kubernetes, Grafana, Dr. Okafor. It helps the transcript spell them correctly.

## `includeSegments` (type: `boolean`):

Adds each sentence with its start and end time. Turn off for smaller output.

## `chunkSize` (type: `integer`):

Set to about 1000 to also get the transcript cut into chunks of roughly that size, each with start and end time. 0 means off.

## `outputFormats` (type: `array`):

Also include the transcript as Markdown, or as an SRT or WebVTT subtitle file.

## `maxMinutesPerFile` (type: `integer`):

Skip files longer than this, so a surprise two-hour file can't cost more than you planned. Skipped files are free.

## `estimateOnly` (type: `boolean`):

Measure each file's length and show what transcribing it would cost, without transcribing anything. This is free.

## Actor input object example

```json
{
  "urls": [
    "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
  ],
  "includeSegments": true,
  "chunkSize": 0,
  "estimateOnly": false
}
```

# Actor output Schema

## `transcripts` (type: `string`):

All results for this run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codepulsehq/speech-to-text-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"] }

# Run the Actor and wait for it to finish
run = client.actor("codepulsehq/speech-to-text-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
  ]
}' |
apify call codepulsehq/speech-to-text-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codepulsehq/speech-to-text-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/J0GDBXE2EW2q9DwTD/builds/H6LgbB4oBve6nmz58/openapi.json
