Delv
Deepgram
Getting Started Guide

How to Use Deepgram

A practical guide to get you up and running with Deepgram. Written by Delv Editorial, Delv Team.

Getting started with Deepgram

In this guide, you will learn how to set up and use Deepgram's speech recognition API for real-time and batch transcription. By the end, you'll be able to transcribe audio efficiently using their powerful features.

Step 1: Sign up and set up

  1. Go to Deepgram's website.
  2. Click on the "Sign Up" button in the top right corner.
  3. Fill in your details and create an account. You’ll receive $200 in free credits to get started.
  4. After signing up, log in to your account and navigate to the "API Keys" section in the dashboard.
  5. Click on "Create API Key" to generate your unique key, which you’ll need for making API calls.

Step 2: Your first transcription

  1. Open your preferred code editor or terminal.
  2. Install the Deepgram SDK (if using JavaScript, for example) by running:
npm install @deepgram/sdk
  1. Use the following sample code to make your first transcription request:
const Deepgram = require('@deepgram/sdk');
   const deepgram = new Deepgram('YOUR_API_KEY');

(async () => {
const response = await deepgram.transcription.preRecorded({
url: 'YOUR_AUDIO_FILE_URL',
});
console.log(response);
})();


  1. Replace 'YOUR_API_KEY' with the API key you created and 'YOUR_AUDIO_FILE_URL' with the URL of the audio file you want to transcribe.

  2. Run the code, and you should see the transcription output in your console.


Step 3: Get better results


  1. Use the language parameter to specify the language of the audio for better accuracy. For example:

const response = await deepgram.transcription.preRecorded({
url: 'YOUR_AUDIO_FILE_URL',
language: 'en-US',
});

  1. For real-time transcription, refer to the WebSocket API in the documentation to set up streaming.

  2. Experiment with different models in the API (like nova or standard) by specifying model in your request for tailored results.


Pro tip


Use the punctuate parameter set to true in your API request to automatically add punctuation to the transcriptions, making them more readable without extra processing.

Common mistake to avoid

Avoid using audio files that are too long for your first tests. Start with shorter clips (under 60 seconds) to quickly see results and troubleshoot any issues without waiting long periods.