Developer API

channel PEAR offers a free RESTful API for developing custom integrations. To get started simply generate your keys, read the docs and go!

sign up free   login

{
    "description": "RESTful API for channel PEAR",
    "base": "https://channelpear.com/api/v1",
    "version": 1.2
}
GET
/library

Returns the contents of your library with info about each source. Results are limited to 100 per page.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/library
  • Example response
  • {
        "data": [
            {
            	"id": 1,
            	"title": "Example Title",
            	"description": "Example Description",
            	"image": "http://example.com/image.jpg",
            	"url": "http://example.com/stream.m3u8",
            	"favorite": true,
            	"status": "online",
            	"updated": "2015-03-21 13:27:25"
            },
            {
            	"id": 2,
            	"title": "Example Title",
            	"description": "Example Description",
            	"image": "http://example.com/image.jpg",
            	"url": "http://example.com/stream.m3u8",
            	"favorite": true,
            	"status": "offline",
            	"updated": "2015-03-21 13:27:25"
            },
            {...},
            {...}
        ],
        "pagination": {
            "next": "https://channelpear.com/api/v1/library/page/2"
        }
    }
  • Data legend
  • id:             unique ID of media source (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    favorite:       favorite indicator (boolean)
    status:         online, offline, geolocked, flagged (string)
    updated:        timestamp of last update (string)
  • Pagination legend
  • next:           request URL for next page of results (string)
GET
/library/page/:number

Returns the contents of your library starting at a specific page.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/library/page/3
  • Example response
  • {
        "data": [
            {
                "id": 1,
                "title": "Example Title",
                "description": "Example Description",
                "image": "http://example.com/image.jpg",
                "url": "http://example.com/stream.m3u8",
                "favorite": true,
                "status": "online",
                "updated": "2015-03-21 13:27:25"
            },
            {
                "id": 2,
                "title": "Example Title",
                "description": "Example Description",
                "image": "http://example.com/image.jpg",
                "url": "http://example.com/stream.m3u8",
                "favorite": true,
                "status": "offline",
                "updated": "2015-03-21 13:27:25"
            },
            {...},
            {...}
        ],
        "pagination": {
            "previous": "https://channelpear.com/api/v1/library/page/2",
            "next": "https://channelpear.com/api/v1/library/page/4"
        }
    }
  • Data legend
  • id:             unique ID of media source (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    favorite:       favorite indicator (boolean)
    status:         online, offline, geolocked, flagged (string)
    updated:        timestamp of last update (string)
  • Pagination legend
  • previous:       request URL for previous page of results (string)
    next:           request URL for next page of results (string)
GET
/library/:id

Returns detailed information on the provided ID.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/library/1
  • Example response
  • {
    	"id": 1,
    	"title": "Example Title",
    	"description": "Example Description",
    	"image": "http://example.com/image.jpg",
    	"url": "http://example.com/stream.m3u8",
    	"favorite": true,
    	"status": "online",
    	"updated": "2015-03-21 13:27:25"
    }
  • Response legend
  • id:             unique ID of media source (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    favorite:       favorite indicator (boolean)
    status:         online, offline, geolocked, flagged (string)
    updated:        timestamp of last update (string)
GET
/library/stats

Returns statistics for your library.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/library/stats
  • Example response
  • {
            "sources": 300,
            "favorites": 15,
            "devices": 3
    }
  • Response legend
  • sources:        total number of media sources (integer)
    favorites:      total number of favorite media sources (integer)
    devices:        total number of devices (integer)
GET
/library/favorites

Returns favorited media sources from your library. Results are limited to 100 per page.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/library/favorites
  • Example response
  • {
        "data": [
            {
            	"id": 1,
            	"title": "Example Title",
            	"description": "Example Description",
            	"image": "http://example.com/image.jpg",
            	"url": "http://example.com/stream.m3u8",
            	"favorite": true,
            	"status": "online",
            	"updated": "2015-03-21 13:27:25"
            },
            {
            	"id": 2,
            	"title": "Example Title",
            	"description": "Example Description",
            	"image": "http://example.com/image.jpg",
            	"url": "http://example.com/stream.m3u8",
            	"favorite": true,
            	"status": "offline",
            	"updated": "2015-03-21 13:27:25"
        	},
            {...},
            {...}
        ],
        "pagination": {
            "next": "https://channelpear.com/api/v1/library/favorites/page/2"
        }
    }
  • Data legend
  • id:             unique ID of media source (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    favorite:       favorite indicator (boolean)
    status:         online, offline, geolocked, flagged (string)
    updated:        timestamp of last update (string)
  • Pagination legend
  • next:           request URL for next page of results (string)
GET
/library/favorites/page/:number

Returns favorite sources in your library starting at a specific page.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/library/favorites/page/3
  • Example response
  • {
        "data": [
            {
                "id": 1,
                "title": "Example Title",
                "description": "Example Description",
                "image": "http://example.com/image.jpg",
                "url": "http://example.com/stream.m3u8",
                "favorite": true,
                "status": "online",
                "updated": "2015-03-21 13:27:25"
            },
            {
                "id": 2,
                "title": "Example Title",
                "description": "Example Description",
                "image": "http://example.com/image.jpg",
                "url": "http://example.com/stream.m3u8",
                "favorite": true,
                "status": "offline",
                "updated": "2015-03-21 13:27:25"
            },
            {...},
            {...}
        ],
        "pagination": {
            "previous": "https://channelpear.com/api/v1/library/favorites/page/2"
            "next": "https://channelpear.com/api/v1/library/favorites/page/4"
        }
    }
  • Data legend
  • id:             unique ID of media source (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    favorite:       favorite indicator (boolean)
    status:         online, offline, geolocked, flagged (string)
    updated:        timestamp of last update (string)
  • Pagination legend
  • previous:       request URL for previous page of results (string)
    next:           request URL for next page of results (string)
POST
/library

Adds a media source to your library.

  • Post fields: title, image, url
  • Example request
  • curl -u USER_ID:API_KEY -X POST \
        --data-urlencode 'title=Title' \
        --data-urlencode 'image=http://example.com/image.jpg' \
        --data-urlencode 'url=http://example.com/stream.m3u8' \
        https://channelpear.com/api/v1/library
  • Example response
  • {
        "success": "media source added"
    }
PUT
/library/:id/title

Updates the specified media source title

  • Data: Title (required)
  • Example request
  • curl -u USER_ID:API_KEY -X PUT \
        -d 'New Title' \
        https://channelpear.com/api/v1/library/:id/title
  • Example response
  • {
    	"success": "media source title updated"
    }
PUT
/library/:id/image

Updates the specified media source image.

  • Data: Image URL (required)
  • Example request
  • curl -u USER_ID:API_KEY -X PUT \
        -d 'http://example.com/image.jpg' \
        https://channelpear.com/api/v1/library/:id/image
  • Example response
  • {
        "success": "media source image updated"
    }
PUT
/library/:id/url

Updates the specified media source URL.

  • Data: URL (required)
  • Example request
  • curl -u USER_ID:API_KEY -X PUT \
        -d 'http://example.com/stream.m3u8' \
        https://channelpear.com/api/v1/library/:id/url
  • Example response
  • {
    	"success": "media source URL updated"
    }
DELETE
/library/:id

Deletes the specified media source from your library.

  • Example request
  • curl -u USER_ID:API_KEY -X DELETE https://channelpear.com/api/v1/library/:id
  • Example response
  • {
    	"success": "media source deleted"
    }
GET
/mediadb

Returns detailed information on all your submitted media DB posts. Results are limited to 100 per page.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/mediadb
  • Example response
  • {
        "data": [
            {
        		"postid": 1,
        		"title": "Example Title",
        		"description": "Example Description",
        		"image": "http://example.com/image.jpg",
        		"url": "http://example.com/stream.m3u8",
        		"category": "News",
        		"created": "2015-03-21 13:27:25",
        		"updated": "2015-03-21 13:27:25",
        		"status": "active",
        		"watchers": 10
        	},
        	{
        		"postid": 2,
        		"title": "Example Title",
        		"description": "Example Description",
        		"image": "http://example.com/image.jpg",
        		"url": "http://example.com/stream.m3u8",
        		"category": "News",
        		"created": "2015-03-21 13:27:25",
        		"updated": "2015-03-21 13:27:25",
        		"status": "hidden",
        		"watchers": 10
        	},
            {...},
            {...}
        ],
        "pagination": {
            "next": "https://channelpear.com/api/v1/mediadb/page/2"
        }
    }
  • Data legend
  • postid:         unique ID of media DB post (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    category:       category of media source (string)
    created:        timestamp of media source creation (string)
    updated:        timestamp of last update (string)
    status:         active or hidden (string)
    watchers:       total users with this source in their library (integer)
  • Pagination legend
  • next:           request URL for next page of results (string)
GET
/mediadb/page/:number

Returns detailed information on all your submitted media DB posts starting at a specific page.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/mediadb/page/3
  • Example response
  • {
        "data": [
            {
                "postid": 1,
                "title": "Example Title",
                "description": "Example Description",
                "image": "http://example.com/image.jpg",
                "url": "http://example.com/stream.m3u8",
                "category": "News",
                "created": "2015-03-21 13:27:25",
                "updated": "2015-03-21 13:27:25",
                "status": "active",
                "watchers": 10
            },
            {
                "postid": 2,
                "title": "Example Title",
                "description": "Example Description",
                "image": "http://example.com/image.jpg",
                "url": "http://example.com/stream.m3u8",
                "category": "News",
                "created": "2015-03-21 13:27:25",
                "updated": "2015-03-21 13:27:25",
                "status": "hidden",
                "watchers": 10
            },
            {...},
            {...}
        ],
        "pagination": {
            "previous": "https://channelpear.com/api/v1/mediadb/page/2"
            "next": "https://channelpear.com/api/v1/mediadb/page/4"
        }
    }
  • Data legend
  • postid:         unique ID of media DB post (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    category:       category of media source (string)
    created:        timestamp of media source creation (string)
    updated:        timestamp of last update (string)
    status:         active or hidden (string)
    watchers:       total users with this source in their library (integer)
  • Pagination legend
  • previous:       request URL for previous page of results (string)
    next:           request URL for next page of results (string)
GET
/mediadb/:postid

Returns detailed information on the provided media DB post ID. You must be the user that submitted the media DB post to retrieve information on it.

  • Example request
  • curl -u USER_ID:API_KEY https://channelpear.com/api/v1/mediadb/1
  • Example response
  • {
    	"postid": 1,
    	"title": "Example Title",
    	"description": "Example Description",
    	"image": "http://example.com/image.jpg",
    	"url": "http://example.com/stream.m3u8",
    	"category": "News",
    	"created": "2015-03-21 13:27:25",
    	"updated": "2015-03-21 13:27:25",
    	"status": "active",
    	"watchers": 10
    }
  • Response legend
  • postid:         unique ID of media DB post (integer)
    title:          title of media source (string)
    description:    description of media source (string)
    image:          image URL of media source (string)
    url:            URL of media source (string)
    category:       category of media source (string)
    created:        timestamp of media source creation (string)
    updated:        timestamp of last update (string)
    status:         active or hidden (string)
    watchers:       total users with this source in their library (integer)
PUT
/mediadb/:postid/url

Updates the URL of the specified media DB post ID. You must be the user that submitted the media DB post to update it.

  • Data: URL (required)
  • Example request
  • curl -u USER_ID:API_KEY -X PUT \
        -d 'http://example.com/stream.m3u8' \
        https://channelpear.com/api/v1/mediadb/:postid/url
  • Example response
  • {
    	"success": "post URL updated"
    }
PUT
/mediadb/:postid/title

Updates the title of the specified media DB post ID. You must be the user that submitted the media DB post to update it.

  • Data: Title (required)
  • Example request
  • curl -u USER_ID:API_KEY -X PUT \
        -d 'New Title' \
        https://channelpear.com/api/v1/mediadb/:postid/title
  • Example response
  • {
    	"success": "post title updated"
    }
PUT
/mediadb/:postid/description

Updates the description of the specified media DB post ID. You must be the user that submitted the media DB post to update it.

  • Data: Description (required)
  • Example request
  • curl -u USER_ID:API_KEY -X PUT \
        -d 'New Description' \
        https://channelpear.com/api/v1/mediadb/:postid/description
  • Example response
  • {
    	"success": "post description updated"
    }
PUT
/mediadb/:postid/image

Updates the image of the specified media DB post ID. You must be the user that submitted the media DB post to update it.

  • Data: Image URL (required)
  • Example request
  • curl -u USER_ID:API_KEY -X PUT \
        -d 'http://example.com/image.jpg' \
        https://channelpear.com/api/v1/mediadb/:postid/image
  • Example response
  • {
    	"success": "post image updated"
    }