Prompt

How do I use an API to turn articles into spoken audio?

Artificial Intelligence / Speech & Voice AI1 observationLast seen Oct 11, 2026

Latest observation

Oct 11, 2026OpenAI APIWeb search: off

You typically do this in two API steps:

  1. Get the article text
  2. Send the text to a text-to-speech (TTS) API to generate audio

Common workflow

1) Extract the article content

If the article is on a web page, you first need the readable text, not the whole HTML. You can:

  • scrape the page and extract main text
  • use an article extraction library/service
  • get the article from your CMS or database if you already store it

2) Send text to a TTS API

Use a speech API such as:

  • OpenAI TTS
  • Amazon Polly
  • Google Cloud Text-to-Speech
  • Azure Speech
  • ElevenLabs

These APIs usually let you choose:

  • voice
  • language
  • format like MP3, WAV, OGG
  • sometimes speed, pitch, or style

3) Save or stream the audio

The API returns audio data or a downloadable file. You can:

  • save it as article.mp3
  • play it in your app
  • stream it to the user

Example: basic Python flow

import requests

article_text = """
This is the article text you want spoken aloud.
"""

# Example: send to a TTS API
response = requests.post(
    "https://api.example.com/tts",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "text": article_text,
        "voice": "neutral",
        "format": "mp3"
    }
)

with open("article.mp3", "wb") as f:
    f.write(response.content)

If the article is long

Most TTS APIs have a text length limit per request. For long articles:

  • split the article into chunks by paragraph or section
  • convert each chunk separately
  • concatenate the audio files afterward

Things to watch out for

  • Copyright/licensing: make sure you have rights to convert the article to audio
  • Text cleanup: remove nav text, ads, captions, and boilerplate
  • Pronunciation: format dates, abbreviations, and acronyms for better speech
  • Chunking: keep chunks natural, like paragraphs
  • Cost: TTS is usually billed by characters or minutes

Best practice architecture

  1. User submits article URL or pastes text
  2. Backend extracts and cleans article text
  3. Backend sends chunks to TTS API
  4. Backend merges audio files
  5. User downloads or listens in-app

If you want, I can give you:

  • a working example in Python, JavaScript, or Node.js
  • a version using OpenAI / Amazon Polly / ElevenLabs
  • a full app flow for URL → spoken MP3

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.