General Information
The Fembed API provides all data available on the dashboard
Fembed exposes its data via an Application Programming Interface (API), so developers can interact in a programmatic way with the Fembed application. This document is the official reference for that functionality. The current API version is 1.1.2
The Base-URL for all api calls:
https://www.fembed.com/api
Making Request
All calls to the API shall be HTTP/1.1 POST, most calls require ClIENT_ID
and ClIENT_SECRET
,
you can find them in My Account
curl -X POST https://www.fembed.com/api/ACTION
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-H "Content-Type: application/x-www-form-urlencoded"
Response format
Response is Json, structure is as follows:
{
"success": boolean | TRUE or FALSE,
"data": mix | depend on the request
}
API Calls
The list all api calls available on the latest version of our API
Account Information
curl -X POST https://www.fembed.com/api/account
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
The success response
{
"success": true
"data": {
"id": 2097657,
"display_name": "John Doe",
"email": "[email protected]",
"credit": 988,
"is_active": true,
"reason": null,
"is_subscribe": true,
"created_at": "2018-01-24 20:41:22"
}
}
The error response
{
"success": false
"data": "403 your account is banned"
}
Get Upload URL
This call will return upload url and token for your next upload call, the token is only valid 1 hour
curl -X POST https://www.fembed.com/api/upload
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
The successfully response
{
"success": true,
"data": {
"url": "https://www.fembed.com/upload/",
"token": "43tds46rgsrrere"
}
}
The error response
{
"success": false,
"data": "403 invalid client secret"
}
Upload Video
We use Tus Resumable upload protocol, version 1.0.0, so you can use any tus clients you want to upload video. upload url is your endpoint,
and upload token must be included in Upload-Metadata
header with key is token
.
Please visit Tus.io for more information
Upload-Metadata must include key name
too,it's value is name of file will upload
Tus Clients: Please check at https://tus.io/implementations.html
When uploaded successfully, you have to exec the final upload api call to get fembed video id. Please note that video id may be delayed by a short duration, so it may not available immediately, but may upto maximum 20 seconds. If after 20 seconds still not available then the video is not encode-able so it was removed
curl -X POST https://www.fembed.com/api/fingerprint
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "file_fingerprint=8642rwre4sd3"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
file_fingerprint
: Required, fingerprint of file.
eg upload url ishttps://www.fembed.com/upload/8642rwre4sd3
then fingerprint is8642rwre4sd3
The successfully response
{
"success": true,
"data": FembedVideoId
}
The error response
{
"success": false,
"data": "404 fingerprint not found"
}
Upload Video Caption
We support 2 types of captions/subtitles: WebVTT, SRT. Multiple cap/sub per video is allowed.
curl -X POST https://www.fembed.com/api/caption
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "file_id=IdOfVideo&captions=JSON_ENCODED"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
file_id
: Required, ID of target videocaptions
: Required, JSON encoded array contain object of each caption info.
eg[{"title": "English", "type": "vtt", "content": "content from php file_get_contents()"},{"title": "Japanese"....}]
The successfully response
{
"success": true,
"data": ["English", "Japanese"]
}
The error response
{
"success": false,
"data": "404 video not found"
}
Upload Video Poster
We support only jpg, jpeg, png image file. the old poster will be remove if new poster uploaded successfully.
curl -X POST https://www.fembed.com/api/poster
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "file_id=IdOfVideo&poster=JSON_ENCODED"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
file_id
: Required, ID of target videoposter
: Required, JSON encoded object contain image info.poster.type
andposter.content
eg{"type": "png", "content": base64_encode(file_get_contents(/path/to/image.png))}
eg{"type": "url", "content": "http://host.image/file.jpg"}
The successfully response
{
"success": true,
"data": "IdOfVideo"
}
The error response
{
"success": false,
"data": "400 not a valid image"
}
Transfer Videos to Fembed
Please login to your account and check list of supported hosts and their valid formats
curl -X POST https://www.fembed.com/api/transfer
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "links=JSON_ENCODED_ARRAY"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
links
: Required, JSON encoded array of source links
The successfully response
{
"success": true,
"data": "OK"
}
The error response
{
"success": false,
"data": "Link(s) submited is invalid format"
}
Transfering Status
Make a call without remove_ids
and retry_ids
, you will get current status of your transfering.
If remove_ids
is present, then retry_ids
will be ignored (mean you can not do two operations on one call)
curl -X POST https://www.fembed.com/api/transfering
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "remove_ids=JSON_ENCODED_ARRAY"
-d "retry_ids=JSON_ENCODED_ARRAY"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
remove_ids
: Optional, JSON encoded array of Transfer ID you want to removeretry_ids
: Optional, JSON encoded array of Transfer ID you want to retry
The successfully response
{
"success": true,
"data": [
{"id": 1, "type": "Openload", "video_id": "abczyx", "status": "Downloading", "file_id": null, ....},
{"id": 2, "type": "Youtube", "video_id": "123abc", "status": "Cloned", "file_id": "FembedID",....}
]
}
The error response
{
"success": false,
"data": "403 Could not remove transfer task(s): not yours or running"
}
Video Information
curl -X POST https://www.fembed.com/api/file
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "file_id=IdOfVideo"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Optional, yourClIENT_ID
, if not then return public info instead of full infosclient_secret
: Optional, yourClIENT_SECRET
, if not then return public info instead of full infosfile_id
: Required, ID of video you want to check
The success response
{
"success": true,
"data": {
"status": "Removed",
"reason": "Removed by user"
}
}
The error response
{
"success": false,
"data": "404 file not found"
}
Cloning Video
curl -X POST https://www.fembed.com/api/clone
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "file_id=IdOfVideo&title=NEW_TITLE"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
file_id
: Required, ID of video you want to clone (source video)title
Optional, title of new video, otherwise current title will be use
The success response
{
"success": true,
"data": NewVideoID
}
The error response
{
"success": false,
"data": "404 file not found"
}
Get Streaming Link
This is premium feature, your account must have enough credits. Return direct streaming links that you can use on your own player
curl -X POST https://www.fembed.com/api/streaming
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-d "file_id=IdOfVideo&ip_address=12.34.56.78"
-H "Content-Type: application/x-www-form-urlencoded"
client_id
: Required, yourClIENT_ID
client_secret
: Required, yourClIENT_SECRET
file_id
: Required, your video idip_address
: Optional, streaming link is playable for this IP only. If not then streaming link will not restrict base on IP
The successfully response
{
"success": true,
"data": {
files: {
"360p": "https://fembed.com/token-360p.mp4",
"480p": "https://fembed.com/token-480p.mp4",
"720p": "https://fembed.com/token-720p.mp4",
"1080p": "https://fembed.com/token-1080p.mp4",
},
captions: {
"English": "https://fembed.com/token.vtt",
"Russian": "https://fembed.com/token.srt",
},
is_vr: false,
}
}
The error response
{
"success": false,
"data": "403 your account is out of credits"
}