Skip to main content
Last Updated: April 7, 2025 Facebook URLs are not natively downloadable, which can be a challenge when working with the Salad Transcription API, which requires downloadable audio links. However, you can extract audio from Facebook videos, upload it to Salad Simple Storage Service free of charge, and use the resulting link with the API. This guide will walk you through the process to batch transcribe multiple Facebook videos and save the outputs.

Prerequisites

Before you begin, make sure you have:
  1. Python Installed: Ensure you have Python 3.8 or higher.
  2. Libraries Installed: Use the following command to install the required libraries:
  3. FFmpeg Installed: FFmpeg is needed by yt-dlp for processing audio:
    • Linux: sudo apt install ffmpeg
    • MacOS: brew install ffmpeg
    • Windows: Download FFmpeg and add it to your system PATH.
  4. Salad API Key: Ensure you have a valid Salad API key.

Step 1: Import Libraries

To start, import the required Python libraries:

Step 2: Define Functions

1. Download Audio from Facebook This function downloads the best-quality audio from a Facebook video:
  • Facebook videos must be in the format https://www.facebook.com/user/videos/name-of-video/38947598374958739457/. Reels, or other video URL formats are not currently supported.
2. Upload Audio to Salad Storage This function uploads the audio file to Salad Storage and generates a presigned URL:

Step 3: Define Variables

Set the variables required for the process:
  • Adjust the SALAD_API_KEY and ORGANIZATION_NAME variables to your Salad API key and organization name.
  • Add all of your Facebook URLs to the Facebook_URLS list.
  • Facebook videos must be in the format https://www.facebook.com/user/videos/name-of-video/38947598374958739457/. Reels, or other video URL formats are not currently supported.

Step 4: Batch Process Multiple URLs

To process multiple Facebook URLs, use the following script:

Expected Output

A url_mappings.json file is generated with the mappings:
  • Salad Storage supports a max file size of 100MB. If the Facebook video is too long, you may need to split the audio or use a different storage solution.

Step 5: Send Prepared URLs to the Salad Transcription API

Once the audio files are uploaded to Salad Storage and you have the corresponding signed URLs, the final step is to send these URLs to the Salad Transcription API for processing. You can find detailed instructions on how to send requests a to the Salad Transcription API in the official documentation: Salad Transcription API Documentation Below, we provide a function to send a transcription request to the API and retrieve the job_id.

Function to Send a Transcription Request

This function sends a transcription request to the Salad Transcription API for a single URL:

Expected Output

If the request is successful, the API will return a job_id and our function will print it out:
You should also have a jobs.json file with the mappings:
The job_id is a unique identifier for the transcription job. You can use it later to check the job status or retrieve the final result.

Step 6: Retrieve the Transcription Result

If you did not specify a webhook to receive the result, you can manually retrieve the transcription result using the job_id returned in Step 5.

Function to Retrieve Transcription Results

This function retrieves the result of a transcription job from the Salad Transcription API:

Expected Output

If the job is still processing:
If the job is completed:
The completed transcriptions will be saved in a text file with the job_id as the filename:
A full JSON response is also saved in a JSON file named output_JOB_ID.json for your further processing.

Full Script

Here is the full script combining all the steps: