For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Ask AIPlaygroundLoginFree API Key
HomeAPI ReferenceVoice AgentSpeech-to-TextText-to-SpeechIntelligenceSelf-Hosted Deployments
HomeAPI ReferenceVoice AgentSpeech-to-TextText-to-SpeechIntelligenceSelf-Hosted Deployments
    • Getting Started with Speech to Text
  • Pre-Recorded Audio
    • Getting Started
    • Feature Overview
    • Template Apps
  • Streaming Audio
    • Compare Flux to Nova-3
  • Models and Languages
    • Models & Languages Overview
    • Languages Support
    • Language Detection
    • Multilingual Codeswitching
    • Model Options
    • Version
  • Formatting
    • Speaker Diarization
    • Dictation
    • Filler Words
    • Measurements
    • Numerals
    • Paragraphs
    • Profanity Filtering
    • Punctuation
    • Redaction
    • Smart Formatting
    • Supported Entity Types
    • Utterances
    • Utterance Split
  • Custom Vocabulary
    • Find and Replace
    • Keyterm Prompting
    • Keywords
    • Search
  • Media Input Settings
    • Channels
    • Encoding
    • Multichannel
    • Sample Rate
  • Results Processing
    • Understanding Word Confidence Scores
    • STT Callback
    • STT Tagging
    • Extra Metadata
  • Migrating
    • Migrating From Amazon Web Services (AWS) Transcribe to Deepgram
    • Migrating From Google Speech-to-Text (STT) to Deepgram
    • Migrating From OpenAI Whisper to Deepgram
    • Migrating from AssemblyAI Speech-to-Text to Deepgram
LogoLogo
Ask AIPlaygroundLoginFree API Key
On this page
  • Enable Feature
  • Curl Example
  • Query Parameters
  • Analyze Response
  • Response Example
  • Measurements List
Formatting

Measurements

Measurements automatically formats spoken measurement units into their respective abbreviations.
Was this page helpful?
Previous

Numerals

Numerals converts numbers from written format to numerical format.
Next
Built with

measurements booleanDefault: false

Pre-recorded Streaming:NovaStreaming: Flux English (all available regions)

The Measurements feature in Deepgram’s Speech-to-Text API allows for the automatic conversion of spoken measurement units into their respective abbreviations.

By enabling this feature, terms such as “milligram” will be transcribed as “mg”.

Enable Feature

To enable the Measurements feature, you need to set the measurements parameter to true when making an API request.

measurements=true

Curl Example

To transcribe audio with the Measurements feature enabled, use the following cURL command:

cURL
$curl \
> --request POST \
> --header 'Authorization: Token YOUR_DEEPGRAM_API_KEY' \
> --header 'Content-Type: audio/wav' \
> --data-binary @youraudio.wav \
> --url 'https://api.deepgram.com/v1/listen?measurements=true'

Replace YOUR_DEEPGRAM_API_KEY with your Deepgram API Key.

Query Parameters

ParameterValueData TypeDescription
measurementstrue / falsebooleanEnables the Measurements feature to convert spoken measurements to abbreviations. Default is false.

Analyze Response

When the Measurements feature is enabled, the transcribed text will contain abbreviations for measured units.

Response Example

JSON
1{
2 "metadata": {
3 "transaction_key": "your-transaction-key",
4 "request_id": "your-request-id",
5 "created": "2023-01-01T00:00:00Z",
6 "duration": 30.0
7 },
8 "results": [
9 {
10 "channels": [
11 {
12 "alternatives": [
13 {
14 "transcript": "I just ate 33 g of pasta and drank 55 ml of water.",
15 "confidence": 0.98,
16 "words": [
17 {
18 "word": "I",
19 "start": 0.0,
20 "end": 0.2,
21 "confidence": 0.99
22 },
23 {
24 "word": "just",
25 "start": 0.2,
26 "end": 0.4,
27 "confidence": 0.98
28 },
29 {
30 "word": "ate",
31 "start": 0.5,
32 "end": 0.7,
33 "confidence": 0.97
34 },
35 {
36 "word": "33",
37 "start": 0.8,
38 "end": 1.0,
39 "confidence": 0.96
40 },
41 {
42 "word": "g",
43 "start": 1.1,
44 "end": 1.3,
45 "confidence": 0.95
46 },
47 {
48 "word": "of",
49 "start": 1.4,
50 "end": 1.5,
51 "confidence": 0.94
52 },
53 {
54 "word": "pasta",
55 "start": 1.6,
56 "end": 1.8,
57 "confidence": 0.93
58 },
59 {
60 "word": "and",
61 "start": 1.9,
62 "end": 2.0,
63 "confidence": 0.92
64 },
65 {
66 "word": "drank",
67 "start": 2.1,
68 "end": 2.3,
69 "confidence": 0.91
70 },
71 {
72 "word": "55",
73 "start": 2.4,
74 "end": 2.5,
75 "confidence": 0.90
76 },
77 {
78 "word": "ml",
79 "start": 2.6,
80 "end": 2.8,
81 "confidence": 0.89
82 },
83 {
84 "word": "of",
85 "start": 2.9,
86 "end": 3.0,
87 "confidence": 0.88
88 },
89 {
90 "word": "water",
91 "start": 3.1,
92 "end": 3.3,
93 "confidence": 0.87
94 }
95 ]
96 }
97 ]
98 }
99 ]
100 }
101 ]
102}

In this example, spoken measurements like “grams” and “milliliters” have been converted to their respective abbreviations “g” and “ml” in the transcript.

Measurements List

The following units will be converted to their abbreviations.

UnitAbbreviation
milligram(s)mg
centigram(s)cg
gram(s)g
kilogram(s)kg
milliliter(s)ml
centiliter(s)cl
liter(s)l
kiloliter(s)kl
millimeter(s)mm
centimeter(s)cm
meter(s)m
kilometer(s)km