Guides
Transcribe from a URL
Let ScribeFiles fetch a file from a public link, such as cloud storage or a podcast feed.
Code examples use API and HEADERS (headers in JavaScript), set up as in the Quickstart.
Send a link
When the file is already online (cloud storage, a CDN, a podcast feed), send its link as JSON and ScribeFiles downloads it for you. The options are the same as for an upload.
curl https://scribefiles.com/v1/transcripts \
-H "Authorization: Bearer $SCRIBEFILES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://cdn.example.com/episodes/42.mp3",
"mode": "studio",
"speaker_labels": true
}'
import os
import requests
res = requests.post(
"https://scribefiles.com/v1/transcripts",
headers={"Authorization": f"Bearer {os.environ['SCRIBEFILES_API_KEY']}"},
json={
"url": "https://cdn.example.com/episodes/42.mp3",
"mode": "studio",
"speaker_labels": True,
},
)
res.raise_for_status()
transcript = res.json()
const res = await fetch("https://scribefiles.com/v1/transcripts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SCRIBEFILES_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://cdn.example.com/episodes/42.mp3",
mode: "studio",
speaker_labels: true,
}),
});
const transcript = await res.json();
The request returns once the file is downloaded and checked, with a 201 and the queued transcript, just like an upload.
Which links work
- Public
http://orhttps://links that return the file itself, with up to 5 redirects. - Signed links from private storage (for example an S3 or Google Cloud Storage signed URL) work too; make sure they stay valid for at least an hour.
- The file type comes from the link's file name, or from the server's
Content-Typewhen the name has no extension. - Links to web pages (for example a YouTube or Dropbox preview page) don't work: link to the media file itself. For Dropbox, change
?dl=0to?dl=1. - For security, links to private network addresses aren't fetched.
Naming the transcript
By default the transcript is named after the file. Send a title to name it yourself, for example the episode title from your feed.
When the download fails
If the link can't be fetched you get a 400 invalid_request whose message gives the reason, for example "Couldn't download the file: its server answered 403." Nothing is counted toward your allowance.
Questions about the API? Contact us.