mirror of
https://github.com/stephengpope/no-code-architects-toolkit.git
synced 2026-12-03 23:08:07 +00:00
Clone
1
API_Endpoints
Shannon Atkinson edited this page 2024-10-30 12:36:47 -07:00
Table of Contents
API Endpoints
The No-Code Architects Toolkit offers a range of REST API endpoints for media conversion, transcription, video manipulation, and more. Each endpoint is accessible with an API_KEY for secure access.
Authentication
Endpoint: /authenticate
- Method:
POST - Description: Authenticates API access using an
API_KEY. To access other endpoints, you must include anX-API-Keyheader with the correct key for each request. - Headers:
X-API-Key(string): Your API key.
- Example Request:
curl -X POST http://localhost:5000/authenticate \ -H "X-API-Key: your_api_key" - Response:
200 OKif the API key is valid.401 Unauthorizedif the API key is invalid.
File Conversion
Endpoint: /media-to-mp3
- Method:
POST - Description: Converts a media file (e.g., video or audio) to MP3 format. You can optionally set the bitrate of the converted file.
- Parameters:
media_url(string, required): The URL of the media file you want to convert to MP3.bitrate(string, optional): The desired bitrate for the MP3 file (e.g.,128k,192k). If omitted, the default bitrate is applied.webhook_url(string, optional): A URL to which a notification is sent once the conversion is complete.
- Example Request:
curl -X POST http://localhost:5000/media-to-mp3 \ -H "Content-Type: application/json" \ -d '{ "media_url": "http://example.com/video.mp4", "bitrate": "128k", "webhook_url": "http://yourapp.com/webhook" }' - Response:
- 200 OK: The conversion completes synchronously if
webhook_urlis not specified. - 202 Accepted: The conversion runs asynchronously, with results sent to the
webhook_urlonce complete. - Example JSON Response:
{ "job_id": "abc123", "filename": "abc123.mp3", "status": "Processing" }
- 200 OK: The conversion completes synchronously if
Transcription
Endpoint: /transcribe-media
- Method:
POST - Description: Transcribes audio or video files, supporting formats like
text,srt, andvtt. You can also include word-level timestamps. - Parameters:
media_url(string, required): The URL of the media file to be transcribed.output_format(string, optional): The format of the transcription output. Options include:text: Plain text format.srt: SubRip Subtitle format for captions.vtt: WebVTT format for captions.
timestamps(boolean, optional): Iftrue, word-level timestamps are included in the transcription.webhook_url(string, optional): A URL to notify upon transcription completion.
- Example Request:
curl -X POST http://localhost:5000/transcribe-media \ -H "Content-Type: application/json" \ -d '{ "media_url": "http://example.com/audio.mp3", "output_format": "srt", "timestamps": true, "webhook_url": "http://yourapp.com/webhook" }' - Response:
- 200 OK: The transcription is returned directly if no
webhook_urlis specified. - 202 Accepted: If
webhook_urlis specified, the transcription runs asynchronously. - Example JSON Response:
{ "job_id": "transcription_001", "status": "Processing", "requested_format": "srt" }
- 200 OK: The transcription is returned directly if no
Video Manipulation
Endpoint: /combine-videos
- Method:
POST - Description: Combines multiple video files into a single video in the order provided.
- Parameters:
video_urls(array, required): An array of URLs pointing to video files that should be combined.webhook_url(string, optional): A URL to notify once the video combination process is complete.
- Example Request:
curl -X POST http://localhost:5000/combine-videos \ -H "Content-Type: application/json" \ -d '{ "video_urls": [ "http://example.com/video1.mp4", "http://example.com/video2.mp4" ], "webhook_url": "http://yourapp.com/webhook" }' - Response:
- 200 OK: If no
webhook_urlis specified. - 202 Accepted: If
webhook_urlis specified, response includes a job ID and status. - Example JSON Response:
{ "job_id": "combine_001", "filename": "combined_video.mp4", "status": "Processing" }
- 200 OK: If no
Endpoint: /caption-video
- Method:
POST - Description: Adds captions to a video file using a provided SRT subtitle file.
- Parameters:
video_url(string, required): URL to the video file.srt_url(string, required): URL to the SRT file containing captions.webhook_url(string, optional): A URL to notify upon captioning completion.
- Example Request:
curl -X POST http://localhost:5000/caption-video \ -H "Content-Type: application/json" \ -d '{ "video_url": "http://example.com/video.mp4", "srt_url": "http://example.com/captions.srt", "webhook_url": "http://yourapp.com/webhook" }' - Response:
- 200 OK: Direct response if
webhook_urlis not specified. - 202 Accepted: Asynchronous processing if
webhook_urlis specified, with the status sent upon completion. - Example JSON Response:
{ "job_id": "caption_001", "filename": "captioned_video.mp4", "status": "Processing" }
- 200 OK: Direct response if
Endpoint: /extract-keyframes
- Method:
POST - Description: Extracts keyframes from a video at specified intervals, useful for creating snapshots or thumbnails.
- Parameters:
video_url(string, required): URL to the video file.interval(integer, optional): Time interval in seconds for capturing keyframes. Defaults to 5 seconds.webhook_url(string, optional): A URL to notify once keyframes have been extracted.
- Example Request:
curl -X POST http://localhost:5000/extract-keyframes \ -H "Content-Type: application/json" \ -d '{ "video_url": "http://example.com/video.mp4", "interval": 10, "webhook_url": "http://yourapp.com/webhook" }' - Response:
- 200 OK: Direct response with keyframes if synchronous.
- 202 Accepted: If asynchronous, status and keyframe URLs will be sent to the webhook upon completion.
- Example JSON Response:
{ "job_id": "keyframes_001", "status": "Processing", "keyframes": ["frame1.jpg", "frame2.jpg", "frame3.jpg"] }
GDrive Upload
Endpoint: /gdrive-upload
- Method:
POST - Description: Uploads a local file to a specified folder in Google Drive. This endpoint requires that Google Drive credentials be configured in the environment variables.
- Parameters:
file_path(string, required): Local path to the file you want to upload.folder_id(string, optional): The Google Drive folder ID where the file should be stored. If not provided, the file is uploaded to the root directory of Google Drive.webhook_url(string, optional): URL to notify once the file upload is complete.
- Example Request:
curl -X POST http://localhost:5000/gdrive-upload \ -H "Content-Type: application/json" \ -d '{ "file_path": "/path/to/file.mp3", "folder_id": "1A2B3C4D5E6F", "webhook_url": "http://yourapp.com/webhook" }' - Response:
- 200 OK: File is uploaded synchronously if
webhook_urlis not specified. - 202 Accepted: If asynchronous, response includes a job ID, and upload status is sent to
webhook_url. - Example JSON Response:
{ "job_id": "gdrive_upload_001", "status": "Processing", "file_url": "https://drive.google.com/file/d/1A2B3C4D5E6F" }
- 200 OK: File is uploaded synchronously if
Audio Mixing
Endpoint: /audio-mixing
- Method:
POST - Description: Mixes the audio from a specified video file with a separate audio file. This is useful for overlaying or replacing the audio in a video.
- Parameters:
video_url(string, required): URL to the video file whose audio will be mixed or replaced.audio_url(string, required): URL to the audio file to mix with the video.webhook_url(string, optional): A URL to notify once the audio mixing process is complete.
- Example Request:
curl -X POST http://localhost:5000/audio-mixing \ -H "Content-Type: application/json" \ -d '{ "video_url": "http://example.com/video.mp4", "audio_url": "http://example.com/audio.mp3", "webhook_url": "http://yourapp.com/webhook" }' - Response:
- 200 OK: If synchronous, returns the URL or local path of the newly mixed file.
- 202 Accepted: If asynchronous, status is sent to
webhook_urlwhen mixing is complete. - Example JSON Response:
{ "job_id": "audio_mix_001", "filename": "mixed_audio_video.mp4", "status": "Processing" }