# Quickstart

Learn how to transcribe pre-recorded audio and video files.

The quickest way to try transcribing for free is by creating a Speechmatics account and using our [web portal](https://portal.speechmatics.com/jobs/create/batch).

<br />

Set up your transcription job and click the View config button on the output page to get the code and use it in the API.

## Using the Batch API[​](#using-the-batch-api "Direct link to Using the Batch API")

### 1. Create an API key[​](#1-create-an-api-key "Direct link to 1. Create an API key")

[Create an API key in the portal here](https://portal.speechmatics.com/settings/api-keys), which you'll use to securely access the API. Store the key as a managed secret.

Enterprise customers may need to speak to [Support](https://support.speechmatics.com) to get your API keys.

### 2. Pick and install a library[​](#2-pick-and-install-a-library "Direct link to 2. Pick and install a library")

Check out our [Batch Python client](https://github.com/speechmatics/speechmatics-python-sdk) or [JavaScript client](https://www.npmjs.com/package/@speechmatics/batch-client) to get started.

PythonPythonJavaScriptJavaScript

Install using pip:

```
pip install speechmatics-batch
```

Install using NPM:

```
npm install @speechmatics/batch-client
```

### 3. Grab a sample file[​](#3-grab-a-sample-file "Direct link to 3. Grab a sample file")

Download and save our [example.wav](https://github.com/speechmatics/speechmatics-js-sdk/raw/7d219bfee9166736e6aa21598535a194387b84be/examples/nodejs/example.wav)

### 4. Run the example[​](#4-run-the-example "Direct link to 4. Run the example")

Replace `YOUR_API_KEY` with your key, then run the script.

PythonPythonJavaScriptJavaScript

```
import asyncio
from speechmatics.batch import AsyncClient, TranscriptionConfig

API_KEY = "YOUR_API_KEY"
AUDIO_FILE= "example.wav"

config = TranscriptionConfig(
    diarization="speaker",
    language="en",
    model="enhanced"
)

async def main():
    client = AsyncClient(api_key=API_KEY)
    result = await client.transcribe(
        audio_file=AUDIO_FILE,
        transcription_config=config
    )
    print(result.transcript_text)
    await client.close()

asyncio.run(main())
```

You should see the following output:

```
SPEAKER S1: Welcome to Speechmatics. We're delighted that you've decided to try our speech to text software to get going. Just create an API key and submit a transcription request to our API. We hope you'll be very impressed by the results. Thank you.
```

```
// This example transcribes a file in NodeJS.
// For examples in other environments, see the link above

import { openAsBlob } from "node:fs";
import { BatchClient } from "@speechmatics/batch-client";

const client = new BatchClient({
  apiKey: YOUR_API_KEY,
  appId: "nodeJS-example",
});

console.log("Sending file for transcription...");

async function transcribeFile() {
  const blob = await openAsBlob("./example.wav");
  const file = new File([blob], "example.wav");

  const response = await client.transcribe(
    file,
    {
      transcription_config: {
        language: "en",
        model: "enhanced",
      },
    },
    "json-v2",
  );

  console.log("Transcription finished!");

  console.log(
    // Transcripts can be strings when the 'txt' format is chosen
    typeof response === "string"
      ? response
      : response.results.map((r) => r.alternatives?.[0].content).join(" "),
  );
}

transcribeFile();
```

You should then see the following output:

```
Sending file for transcription...
Transcription finished!
Welcome to Speechmatics . We're delighted that you've decided to try our speech to text software to get going . Just create an API key and submit a transcription request to our API . We hope you'll be very impressed by the results . Thank you .
```

### Next Steps[​](#next-steps "Direct link to Next Steps")

Now that you have a basic transcription working, explore these features to get more out of your audio.

#### [Speaker Diarization](/speech-to-text/batch/batch-diarization.md)

[Identify who said what by labeling each speaker in your transcript](/speech-to-text/batch/batch-diarization.md)

#### [Custom Dictionary](/speech-to-text/features/custom-dictionary.md)

[Boost transcription accuracy with domain-specific vocabulary](/speech-to-text/features/custom-dictionary.md)

#### [Summarization](/speech-to-text/batch/speech-intelligence/summarization.md)

[Automatically generate concise summaries of your transcripts](/speech-to-text/batch/speech-intelligence/summarization.md)

#### [Sentiment Analysis](/speech-to-text/batch/speech-intelligence/sentiment-analysis.md)

[Detect the sentiment and emotional tone within your transcripts](/speech-to-text/batch/speech-intelligence/sentiment-analysis.md)

#### [Auto Chapters](/speech-to-text/batch/speech-intelligence/auto-chapters.md)

[Segment long transcripts into meaningful, titled chapters](/speech-to-text/batch/speech-intelligence/auto-chapters.md)

#### [Translation](/speech-to-text/features/translation.md)

[Translate your transcripts into other languages automatically](/speech-to-text/features/translation.md)
