SafeShare.TV API

Generate safe links from your site or App!

With a simple HTTP call, you can generate SafeShare links from your own site or application. The API is straightforward and dead simple. This document describes how to do it.

For previous API, try the Legacy Version

You need to make a GET or a POST request to this URL:

https://safeshare.tv/api/generate?url=www.youtube.com/watch?v=jNQXAC9IVRw

The request should have some parameters in the query-string or the request body. Check out the details of parameters and response patterns in the tables below.

Input Parameters

Parameter Description Validation
JSONP If supplied, the response come in JSONP format. Example: jsonp=callback Optional
url (required) Link to the Youtube or Vimeo video page. For example: http://www.youtube.com/watch?v=jNQXAC9IVRw Valid URL to Youtube or Vimeo video
title This will be the title you want to show on your video. If you don't send, be the video title Maximum 200 characters
description Description and/or additional information of the video. If you don't send, the description of video will be cropped by 200 chars Maximum 200 characters
start Define where the video should start playing In seconds; should be somewhere within total video length
end Define where the video should stop playing In seconds; should be somewhere within total video length. Shouldn't be smaller than start

Response Format Sample

The response is sent in JSON or JSONP format. The JSON contains information to let you build your application. This table explains the response:

https://safeshare.tvapi/generate?jsonp=callback&url=www.youtube.com/watch?v=jNQXAC9IVRw
callback({
"status":"success","message":"Safeview was created!",
"data":[{
  "safeshare_id":"ss56218633d0778",
  "title":"Me at the zoo","icon":"http://safeshare.tv/api/serviceimage/ss56218633d0778",
  "thumbnail":"http://safeshare.tv/api/videoimage/ss56218633d0778",
  "length":"00:19",
  "creation_date":"2015-10-17 01:20:19",
  "last_view":"2015-10-17 01:20:19",
  "views":"11",
  "description":"The first video on YouTube.\n\nMaybe it's time to go back to the zoo?",
  "begin":"0",
  "end":"0",
}]})
Key Description
callback Function callback, if you pass a JSONP function, it will be returned.
status Defines the status of your request. success is returned if the request was successful. error is returned if the request failed.
message A human readable message that confirms the success or explains the error if there is any.
data

Contains data of the created SafeShare entry if the request was successful. It contains these fields:

safeshare_id The unique id of the SafeShare entry generated. The id is used to link to the video: https://safeshare.tvv/safeshare_id
title The title of the SafeShare entry.
thumbnail Link to the thumbnail image of video
icon Link to icon of service. Eg: youtube, vimeo.
length The length of original video in readable time format
creation_date Date of creation of the safeshare link
lastview_date Date of last view of the video in safeshare
views Total number of safeshare views
description Short description of video
begin In seconds, define where the video should start playing. Should be somewhere within total video length
end In seconds, define where the video should stop playing. Should be somewhere within total video length. Shouldn't be smaller than b