This is unofficial documentation for Picarto.tv's service APIs. I'm not responsible for anything you do with this information; it is provided as is with no guarantees.
It looks like there is an official well-documented api now: https://docs.picarto.tv/api/ Please use that instead!
- The Picarto API - Official
- The Picarto API - Unofficial
- Web API Endpoints
- Login
- Logout
- Get News Update
- Set News Read
- Set Guest Chat Username
- getuidchat
- Get Chatbox HTML
- Get Video Load Balancer IP
- Get Homepage Info
- Search
- Get Explore Page Info
- Get Show NSFW Warnings
- Get All Communities
- Get Random Communities
- Search Live Channels
- Get Tag Completion
- Get Trending Tags
- Get Languages
- Chat Events
- Misc. Stuff
- Web API Endpoints
Officialy, there is only one api endpoint provided to streamers:
Gives information about your channel. You must go to https://picarto.tv/settings/api to generate the access key for this endpoint.
Endpoint: https://api.picarto.tv/channel/ <accessKey>
Method: GET
Parameters: none
Response:
Returns a JSON Object with the following properties:
idYour streamer id?channelYour channel namechannel_titleYour channel's titleavatar_urlYour avataroffline_imageYour channel's offline imagechat_bannerYour channel's chat bannerthumbnail_urlYour channel's thumbnailbackground_urlYour channel's background imagetagsAn array of your channel's tagslanguage_primaryYour channel's primary languagelanguage_codeThe name of the languageflag_urlThe image of the language's flag
language_secondaryYour channel's secondary language (See: language_primary)followersThe number of followers you havechannel_viewsThe number of views your channel hasis_onlineWhether or not you are streamingis_multistreamWhether or not you are in a multistreammultistream_participantsAn array of people you're in a multistream withcurrent_viewersThe number of people currently watching your streamis_nsfwWhether or not you're channel is marked NSFWcommissions_enabledWhether or not commissions are enabled on your channeltabletThe tablet you are usingprogramThe program you are usingcontent_typeThe type of content you are streamingdescriptionYou're channel's descriptioncommission_infoYou're channel's commission infochannel_urlYour main social linksocial_urlsAn object containing your social links. The key is the type of link and the value is the url.
Response Example:
{
"id": 123456,
"channel": "YourChannel",
"channel_title": "Doing pony things",
"avatar_url": "https://picarto.tv/user_data/usrimg/yourusername/dsdefault.jpg",
"offline_image": "https://picarto.tv/user_default/offlineimage.jpg",
"chat_banner": "",
"thumbnail_url": "https://picarto.tv/user_data/usrimg/yourusername/thumbnail_stream.jpg",
"background_url": "",
"tags": [ "mlp", "programing", "coding", "3d", "fezbot" ],
"language_primary": {
"language_code": "United States",
"flag_url": "https://picarto.tv/images/flags/new/us.png"
},
"language_secondary": { },
"followers": 12,
"channel_views": 381,
"is_online": false,
"is_multistream": false,
"multistream_participants": [ ],
"current_viewers": 0,
"is_nsfw": false,
"commissions_enabled": false,
"tablet": "A paper notebook from Staples",
"program": "My pencil",
"content_type": "Sketching",
"description": "Description stuff :P",
"commission_info": "Commissions and stuf :P",
"channel_url": "http://example.com/",
"social_urls":{
"deviantart":"http://youraccount.deviantart.com/",
"youtube":"https://www.youtube.com/channel/yourchannel"
}
}
This is unofficial documentation for Picarto.tv's service APIs. It's collected through watching client network communication and exploring client source code.
As these endpoints are unofficial, they may break or change at any time. I'm not responsible for anything you do with this information; it is provided as is with no guarantees.
Please be sure to read through Picarto's TOS (https://picarto.tv/site/terms) and make sure you're not breaking them.
These are API endpoints that can be used for comunicating with picarto's services. Unless otherwise specified, all endpoints use https://www.picarto.tv/. You should probably set the referrer to that that as well. Custom user agents don't seem to effect things.
Logs into a picarto account.
Endpoint: /process/login
Method: POST
Form Data:
usernameYour usernamepasswordYour passwordstayloggedWhether or not to stay logged in.trueorfalse
Response:
Returns a JSON Object with the following properties:
loginstatusWhether or not the login was successfull.trueorfalseaccountStatusThe account's status?stayloggedValWhether or not stay logged in was checked.1or-1stayloggedWhether or not stay logged in was checked."true"or"false"
Response Example:
{
"loginstatus": true,
"accountStatus": 0,
"stayloggedVal": "true",
"staylogged":1
}Extra Info:
Auth is based on the PHPSESSID cookie. All further requests must include this cookie for identification and auth. If staylogged is set to true, then the additional picartoSession and picartoCookieID cookies are set, with an expiration of 2 weeks. These cookies will automatically re-auth the PHPSESSID.
Logs out of a picarto account.
Endpoint: /process/logout
Method: POST
Form Data: none
Response:
On success, returns the loneliest number.
Response Example:
1Extra Info:
Logging out invalidates the current session and sets the PHPSESSID, picartoSession, and picartoCookieID cookies to "deleted".
Gets the content for the "News update" popup.
Endpoint: /modules/newsupdate
Method: GET
Parameters: none
Response:
If there is unread news, returns a JSON Object with the following properties:
titleThe title of the news updatedescriptionThe content of the news update
Otherwise the response is empty. (See: Set News Read)
Response Example:
{
"title": "Looking for your Follows?",
"description": "Are you looking for your precious follows? You can find them on our new EXPLORE page!<a target='_blank' href='https:\/\/picarto.tv\/communities\/explore' >Go to Explore!<\/a>"
}Marks the current news as read (the popup woun't show up again for this session and Get News Update's response will be blank). Cannot be unset.
Endpoint: /modules/newsupdate
Method: POST
Parameters:
set_newsreaded: true
Response:
Same as Get News Update
Sets a guest username for chat. Username must contain at least one letter; can only contain letters, underscores, and/or dashes; and must be 20 characters or less. Should be used when you're logged out, I don't know what will happen if you're already logged in.
Endpoint: /process/channel
Method: POST
Form Data:
setusernameThe username to try to use
Response:
Returns a string. Can be any of the following values:
okThe username was set successfullyuserNameRegExThe username does not match the requirementsuserNameTooLongThe username is too longuserNameExistsThe username is already in use
Response Example:
userNameRegEx
I think it sets the channel to use when getting the chatbox HTML? It's allways called before Get Chatbox HTML
Endpoint: /process/channel
Method: POST
Form Data:
getuidchatThe channel you set the guest chat name for
Response:
Returns "idset"
Response Example:
idset
Gets the html for the chatbox. The last line of html also contains javascript with the key needed for connecting to the chat websocket. You will need this if you want to connect to chat.
Endpoint: /modules/channel-chat
Method: GET
Parameters: none
Response:
Returns HTML. The last line contains a <script> tag with chat properties. The initChatVariables function in this script is important!
It has the following parameters:
- Whether or not simple is enabled.
- Whether or not link detection is enabled.
- Whether or not emoticons are enabled.
- Whether or not timestamps are enabled.
- Whether or not sound notifications are enabled.
- Your username in chat.
- The channel the chat is for.
- The key to use to connect to the chat websocket.
Response Example:
...
...
...
<script>initScrollbar();initChatStyle(popoutChat);initChatVariables('0','1','1','0','0','<username>','<channelName>','<chatAuthKey>');changeHeight();</script>
Gets the IP to use for viewing a stream.
Endpoint: /process/channel
Method: POST
Form Data:
loadbalancinginfoThe name of the channel.
Response:
The IP to use, or "failedGetIP".
Response Example:
185.93.1.35Extra Info:
As of at least 10/7/16, the internal code takes this and matches it to an actual URL. The mapping is as follows:
167.114.157.136 => edge1-ca.picarto.tv
167.114.157.137 => edge2-ca.picarto.tv
158.69.55.151 => edge3-ca.picarto.tv
198.27.85.197 => edge4-ca.picarto.tv
185.93.1.35 => edge1-us-east.picarto.tv
185.93.1.33 => edge2-us-east.picarto.tv
default => edge1-us-east.picarto.tv
This is then used to build the video url: "https://" + URL + "/hls/" + Channel + "/index.m3u8"
Gets information about communities and channels for the homepage. More likely to change than the other endpoints so don't rely too heavily on it.
Endpoint: /process/index
Method: POST
Form Data: none
Response:
Returns a JSON object with the following properties:
videosAn array of videos to show on the homepage
Each video object has the following properties:channel_nameThe name of the channelchannel_titleThe title of the channelfeaturedWhether or not the channel is featuredproduct??????offline_imageThe ofline image orfalse
communitiesA list of communities to show on the homepage
Each community object has the following properties:community_idThe id of the comunitycommunity_nameThe name of the communityfileThe image for this community. (it's just the filename - I'm not sure where they're actually stored)
top_streamsA list of the top streams to show on the homepage
Each stream object has the following properties:channel_nameThe name of the channelchannel_titleThe title of the channelcommunity_idThe id of the comunity the stream is incommunity_nameThe name of the community the stream is inproduct??????
top_streamsA list of random streams to show on the homepage (See: top_streams)
Response Example:
{
"videos":[
{
"channel_name":"Twokinds",
"channel_title":"Twokinds",
"featured":false,
"product":0,
"offline_image":false
}
],
"communities":[
{
"community_id":16,
"community_name":"Pony",
"file":"pony.jpg"
}
],
"top_streams":[
{
"channel_name":"Twokinds",
"channel_title":"Twokinds",
"community_id":8,
"community_name":"Furry",
"product":1
}
],
"random_streams":[
{
"channel_name":"manosdetrapo",
"channel_title":"fun times with art and manos",
"community_id":1,
"community_name":"Creative",
"product":1
}
]
}
Searches channels and tags and returns the HTML of the search results.
Endpoint: /modules/search
Method: POST
Form Data:
searchThe thing you're searching for
Response:
Returns the HTML of the search results
Gets info for the 'Explore' page.
Endpoint: /process/explore
Method: POST
Form Data:
initial:truechannels:true
Response:
Returns a JSON object with the following properties:
languagesAn array of all the languages that can be filtered by
Each language object has the following properties:lang_idThe id of the languagelanguageThe name of the languageflagThe image for the flag of the language (it's just the filename - I'm not sure where they're actually stored)online_sfwThe number of SFW channels with this language that are liveonline_nsfwThe number of NSFW channels with this language that are live
channelsAn array of all the channels that are live
Each channel object has the following properties:idThe id of the channelchannel_nameThe name of the channelchannel_titleThe title of the channelchannel_viewersThe number of viewers the channel hasproduct??????adultWhether or not the channel is NSFWcat_idThe category id of the channelcat_nameThe category name of the channellanguage_primaryThe channel's primary languagelanguage_idThe id of the languagelanguage_codeThe name of the languageflag_urlThe image of the language's flag
language_secondaryThe channel's secondary language (See: language_primary)tagsAn array of tags that the channel hasis_multistreamWhether or not the channel is in a multistreamgamemodeWhether or not the channel is in game modecommissionsWhether or not the channel is taking commissions
tagsAn array of trending tagscommunitiesAn array of 4 random communities
Each community object has the following properties:idThe id of the communitynameThe name of the communityviewers_sfwThe number of people currently watching SFW channels within this communityviewers_nsfwThe number of people currently watching NSFW channels within this communityonline_sfwThe number of SFW channels within this community that are liveonline_nsfwThe number of NSFW channels within this community that are livefile_nameThe image file for the community (it's just the filename - I'm not sure where they're actually stored)
Response Example:
{
"languages":[
{
"lang_id":11,
"language":"Argentina",
"flag":"ar.png",
"online_sfw":0,
"online_nsfw":1
}
],
"channels":[
{
"id":88453,
"channel_name":"A Channel",
"channel_title":"The Title",
"channel_viewers":100,
"product":1,
"adult":false,
"cat_id":17,
"cat_name":"Cartoon",
"language_primary":{
"language_id":227,
"language_code":"United States",
"flag":"us.png"
},
"language_secondary":{ },
"tags":[ ],
"is_multistream":false,
"gamemode":false,
"commissions":false
}
],
"tags":[ "furry", "art", "anime", "illustration", "cartoon", "fanart", "anthro", "digital", "pony", "animation", "drawing", "manga", "mlp", "design", "cute", "character", "comic", "sai", "undertale", "commissions" ],
"communities":[
{
"id":10,
"name":"Comic",
"viewers_sfw":115,
"viewers_nsfw":57,
"online_sfw":10,
"online_nsfw":5,
"file_name":"comic.jpg"
}
]
}
Gets whether or not nsfw warnings should be shown.
Endpoint: /process/explore
Method: POST
Form Data:
checksafemode:true
Response:
Returns a JSON array of an object with the following properties:
nsfw_warningsGets whether or not to show nsfw warnings.
Response Example:
[
{
"nsfw_warnings": true
}
]
Gets a list of all available communities
Endpoint: /process/explore
Method: POST
Form Data:
communities:all
Response:
Returns a JSON array of communities
Each community object has the following properties:
idThe id of the communitynameThe name of the communityviewers_sfwThe number of people currently watching SFW channels within this communityviewers_nsfwThe number of people currently watching NSFW channels within this communityonline_sfwThe number of SFW channels within this community that are liveonline_nsfwThe number of NSFW channels within this community that are livefile_nameThe image file for the community (it's just the filename - I'm not sure where they're actually stored)
Response Example:
[
{
"id": 22,
"name": "Adult",
"viewers_sfw": 0,
"viewers_nsfw": 649,
"online_sfw": 0,
"online_nsfw": 69,
"file_name": "adult.jpg"
}
]
Gets a list of 5 random communities
Endpoint: /process/explore
Method: POST
Form Data:
communities:random
Response:
See: Get All Communities
Gets a list of all live channels in a Community.
Endpoint: /process/explore
Method: POST
Form Data:
streams:allcommissionWhether or not the channel takes commissions.trueor blankpremiumWhether or not the channel is premium.trueor blankshuffleWhether or not to shuffle the results.trueor blanklanguageThe language id to filter by.<languageId>or blanktagThe tag to filter by.<tag>or blankcommunityThe community id to filter by.<communityId>or blank
Response:
Returns a JSON array of channel objects
See: Get Explore Page Info -> Response -> channels
Gets a list of tags that start with the given string.
Endpoint: /process/explore
Method: POST
Form Data:
tagsThe string to search for
Response:
Returns a JSON array of tags
Response Example:
["pony","pokemon","porn","pop"]
Gets a list of trending tags
Endpoint: /process/explore
Method: POST
Form Data:
tags:trending
Response:
Returns a JSON array of tags
Response Example:
["anime","art","furry","illustration","fanart","drawing","manga","digital","comic","design","character","pony","anthro","mlp","sai","cute","animation","cartoon","commissions","undertale"]
Gets a list of available languages
Endpoint: /process/explore
Method: POST
Form Data:
languages:true
Response:
Returns a JSON array of language objects
See: Get Explore Page Info -> Response -> languages
Events sent/recieved through the chat websockets.
SEE: https://github.com/Wolvan/PicartoChatBot/blob/v2/resources/picarto_protocol.proto
Miscellaneous things.
These are some common URL's used by picarto's services