API Documentation

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.3

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,
    "code": error code (if any)
}

Before checking json response, you should check http code returned

200: Everything is OK. Request succeeded

Otherwise: Errors from our end. You should not see this, but be prepared.

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, your ClIENT_ID
  • client_secret: Required, your ClIENT_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"
}

Complaints

This call will only return complaints that your action is required

curl -X POST https://www.fembed.com/api/complaint
-d "client_id=ClIENT_ID&client_secret=ClIENT_SECRET"
-H "Content-Type: application/x-www-form-urlencoded"
  • client_id: Required, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET

The success response

{
    "success": true
    "data": [
        {"id": 12345, "files": [vid1,vid2,vid3], "reporter": "[email protected]"},
        {"id": 56789, "files": [vid4,vid5,vid6], "reporter": "[email protected]"}
    ]
}

The error response

{
    "success": false,
    "data": "your account is banned",
    "code": 403
}

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"
-d "folder_id=FOLDER_ID"
-H "Content-Type: application/x-www-form-urlencoded"
  • client_id: Required, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • folder_id: Optional, ID of the target folder you want to upload to

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, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • file_fingerprint: Required, fingerprint of file.
    eg upload url is https://www.fembed.com/upload/8642rwre4sd3 then fingerprint is 8642rwre4sd3

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, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • file_id: Required, ID of target video
  • captions: Required, JSON encoded array contain object of each caption info.
    eg [{"title": "English", "type": "vtt", "content": "base64 encoding of binary data"},{"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, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • file_id: Required, ID of target video
  • poster: Required, JSON encoded object contain image info. poster.type and poster.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, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • links: Required, example {"link1","link2"}

The successfully response

{
    "success": true,
    "data":  ["id_of_task1", "id_of_task2"]
}

The error response

{
    "success": false,
    "data": "error message"
}

Transferring Status

Make a call without remove_ids and retry_ids, you will get current status of your transferring. 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/transferring
-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, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • task_id: Optional, ID of task you want to check, otherwise return all active tasks
  • remove_ids: Optional, IDs you want to remove, example {"id1","id2"}
  • retry_ids: Optional, IDs you want to retry, example {"id1","id2"}

The successfully response

{
    "success": true,
    "data": [
        {"id": 1, "file_id": null, "type": "Openload", "video_id": "abczyx", "status": "Downloading", ....},
        {"id": 2, "file_id": "FembedID", "type": "Youtube", "video_id": "123abc", "status": "Cloned",....}
    ]
}

The error response

{
    "success": false,
    "data": "error message"
}

Download Videos to Fembed

Please login to your account and check list of supported protocol and other requirements (if any)

curl -X POST https://www.fembed.com/api/download
-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, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • links: Required, example [{"link": "link1", "headers": "headers1"},{"link": "link2", "headers": "headers2"}]

The successfully response

{
    "success": true,
    "data":  ["id_of_task1", "id_of_task2"]
}

The error response

{
    "success": false,
    "data": "error message"
}

Downloading Status

Make a call without remove_ids and retry_ids, you will get current status of your downloading. 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/downloading
-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, your ClIENT_ID
  • client_secret: Required, your ClIENT_SECRET
  • task_id: Optional, ID of task you want to check, otherwise return all active tasks
  • remove_ids: Optional, IDs you want to remove, example {"id1","id2"}
  • retry_ids: Optional, IDs you want to retry, example {"id1","id2"}

The successfully response

{
    "success": true,
    "data": [
        {"id": 1, "file_id": null, "title": "your origin url", "status": "Downloading", ....},
        {"id": 2, "file_id": "FembedID", "title": "your other origin", "status": "Task is completed",....}
    ]
}

The error response

{
    "success": false,
    "data": "403 Could not remove download task(s): are they yours"
}

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, your ClIENT_ID, if not then return public info instead of full infos
  • client_secret: Optional, your ClIENT_SECRET, if not then return public info instead of full infos
  • file_id: Required, ID of video you want to check
Private video and Public video

If video is private, client_id and client_secret are required, otherwise 403 error will returned


The success response

{
    "success": true,
    "data": {
        "status": "Removed",
        "reason": "Removed by user"
    }
}

The error response

{
    "success": false,
    "data": "403 Invalid client ID or client Secret"
}

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, your ClIENT_ID
  • client_secret: Required, your ClIENT_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
Private video and Public video

If source video is private and not belong to you, an 451 error will returned, as you do not have READ permission for that video


The success response

{
    "success": true,
    "data": NewVideoID
}

The error response

{
    "success": false,
    "data": "404 file not found"
}
Top