1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Chaturbate Meta API - Journey To Income???

Discussion in 'My Journey Discussions' started by naughtynewell, Aug 14, 2019.

  1. naughtynewell

    naughtynewell Regular Member

    Joined:
    Mar 24, 2013
    Messages:
    237
    Likes Received:
    77
    Hey guys,

    I've built a few of these over the years, but I've finally bitten the bullet, gotten some hosting and am actually going to get some work done in the area.

    I've just soft-launched my API for Chaturbate affiliates. If you're an affiliate and you'd like to be a bit more selective with the performers that you show off on your site, or want to find performers to follow etc then this is the thing for you.

    It's over here:

    Code:
    https://chaturbate-meta.com/api/v1/performer/
    Currently if you don't supply the right information, it will use MY AFFILIATE CODE. I repeat, if you don't do the following you WILL NOT GET THE MONEY FOR ANY HITS ON YOUR SITE.

    When making a request to the API, attach a cookie called
    Code:
    X-CB-API-KEY
    with your webmaster 5/6 character key in, which you can find by looking in the links section of the Chaturbate affiliates website here:

    [​IMG]

    To make sure that the links that are sent back from my API have YOUR api key in this slot, send the cookie with all requests.

    The api has three main urls that you can go to:

    /api/v1/performer/
    /api/v1/performer/<username>/
    /api/v1/performer/<username>/sessions/

    I tried to make these as self explanatory as possible.

    Searching Performers:

    For filtering / sorting on the performer end point you can append any of the following as querystring parameters:

    - online
    - offline
    - sort=<field_to_sort>
    - asc/desc
    - gender=<gender_to_filter>
    - tags=<tags_to_filter>
    - page=<page_to_access>
    - username=<full_or_partial_username>

    Online / Offline:
    Usage:
    - https://chaturbate-meta.com/api/v1/performer/?online
    - https://chaturbate-meta.com/api/v1/performer/?offline
    Effect:
    Find performers that are either only online or only offline. The default (without either) is to return both.

    Sort:
    Usage:
    - https://chaturbate-meta.com/api/v1/performer/?sort=num_users
    Effect:
    Order the returned performers by a particular field. The default sorting direction is descending, the default sort field is num_users.

    Asc/Desc
    Usage:
    - https://chaturbate-meta.com/api/v1/performer/?sort=num_users&desc
    - https://chaturbate-meta.com/api/v1/performer/?sort=num_users&asc
    Effect:
    Reverse the order which the users are returned in. Desc means big to small, asc means small to big.

    Gender:
    Usage:
    - https://chaturbate-meta.com/api/v1/performer/?gender=f
    Effect:
    Restrict the returned performers to a particular gender. Chaturbate stores the gender of each performer as a single character and has four categories:

    'f' - Female
    'm' - Male
    'c' - Couples
    's' - Transgender

    Tags:
    Usage:
    - https://chaturbate-meta.com/api/v1/performer/?tags=bbw,teen
    Effect:
    Restrict the returned performers to only performers that have ALL of the requested tags, not a subset.
    Please note, performers are allowed to set their own tags and there is no validation of them so this field isn't always useful.

    Page:
    Usage:
    - https://chaturbate-meta.com/api/v1/performer/?page=2
    Effect:
    Return the next page in the query set. The performer end point returns a pagination response which contains three fields: results, itemCount, pageCount. Results is an array of performers that are the actual objects you want to inspect, itemCount is the number of performers in the database that match the query supplied and pageCount is the number of pages there are. Currently each page returns 20 results and that is a constant. Leaving this query string param off returns page 1.

    Username:
    Usage:
    - https://chaturbate-meta.com/api/v1/performer/?username=wet
    Effect:
    Return performers whose username matches or partially matches the supplied string.

    Return Object:
    Further to the paginated results, each performer object in the results array should look like this:

    Code:
    {
       "_id":"5d50ffafe6dbe1769c5da3f2",
       "num_followers":387685,
       "tags":[
          "tokenkeno"
       ],
       "username":"onebigkiss",
       "seconds_online":9421,
       "gender":"f",
       "age":26,
       "num_users":10813,
       "created_at":"2019-08-12T05:57:00.000Z",
       "last_seen":"2019-08-12T17:16:00.000Z",
       "online":false,
       "iframe_src":"https://chaturbate.com/in/?tour=Jrvi&amp;campaign=R0ffl&amp;track=embed&amp;room=onebigkiss&amp;bgcolor=white",
       "iframe_revshare_src":"https://chaturbate.com/in/?tour=9oGW&amp;campaign=R0ffl&amp;track=embed&amp;room=onebigkiss&amp;bgcolor=white",
       "image_url":"https://roomimg.stream.highwebmedia.com/ri/onebigkiss.jpg"
    }
    
    I'll go through each one:

    _id: This is an internal field used by my database to identify each performer. Not something you need to worry about.
    num_followers: The total number of followers this performer currently has on Chaturbate.
    tags: An array of strings of tags that the performer has given themselves, I'll note again that this is a field that the user sets themselves and isn't always a good reflection of the content that is on the channel.
    username: Duh.
    seconds_online: The amount of time this user has spent online.
    gender: Duh.
    age: I'll make a note about this one as well. This is a field that is set by the user again and isn't always accurate. You'll find that there are a lot of 99's here.
    num_users: The current number of users watching this performer.
    created_at: The first time this user was seen.
    last_seen: The last time this user was updated with new information.
    online: Duh.
    iframe_src, iframe_revshare_src: These are two fields that use YOUR webmaster key if supplied and can be used to stuff into a iframe to put this performers room on your website.
    image_url: The performers current thumbnail.

    Examples:

    URL:
    https://chaturbate-meta.com/api/v1/performer/?online&gender=f&tags=pussy&username=tiny
    English: Get all online female performers that have the 'pussy' tag and the string 'tiny' in their name
    ---
    URL: https://chaturbate-meta.com/api/v1/performer/?gender=c&sort=num_followers
    English: Get all online & offline couples performers sorted by their follower count in descending.
    ---
    URL: https://chaturbate-meta.com/api/v1/performer/?offline&gender=m&tags=cock,hard&page=3
    English: Get the third page of offline male performers that have both the tags 'cock' and 'hard'


    Viewing A Performer

    OK - say you've used the above method to find yourself a little hottie that you want to find out some more about, now what? Well, you use the next end point in our list: /api/v1/performer/<username>/


    For the sake of this example I'll use the performer 'sexy_b0rsch' as she's a fave.

    Querying the endpoint will result in the following:

    Code:
    {
       "num_followers":323866,
       "seconds_online":126,
       "gender":"f",
       "age":20,
       "last_seen":"2019-08-12T16:16:00.000Z",
       "online":false,
       "recent_sessions":[
          {
             "started_at":"2019-08-12T13:14:00.000Z",
             "avg_users":4910,
             "max_users":8957,
             "min_users":9,
             "duration":144,
             "w_minutes":707045,
             "peak":95
          },
          {
             "started_at":"2019-08-12T15:39:00.000Z",
             "avg_users":2171,
             "max_users":4695,
             "min_users":438,
             "duration":5,
             "w_minutes":10856,
             "peak":0
          },
          {
             "started_at":"2019-08-12T16:10:00.000Z",
             "avg_users":67,
             "max_users":157,
             "min_users":0,
             "duration":7,
             "w_minutes":472,
             "peak":5
          }
       ],
       "w_minutes":718373,
       "max_users":8957,
       "avg_users":2382.6666666666665,
       "avg_duration":52,
       "max_duration":144,
       "iframe_src":"https://chaturbate.com/in/?tour=Jrvi&amp;campaign=R0ffl&amp;track=embed&amp;room=sexy_b0rsch&amp;bgcolor=white",
       "iframe_revshare_src":"https://chaturbate.com/in/?tour=9oGW&amp;campaign=R0ffl&amp;track=embed&amp;room=sexy_b0rsch&amp;bgcolor=white",
       "image_url":"https://roomimg.stream.highwebmedia.com/ri/sexy_b0rsch.jpg"
    }
    
    This is what I'm most proud of in the API. I currently track all sessions that a user performs and then calculate metadata based on those sessions. I'll put a primer at the bottom of this post to show what I did, but as a basic breakdown of the fields here:

    recent_sessions: A max of 5 of this performers most recent sessions.
    w_minutes: The total number of minutes that this performer has been watched. I.E. if 8000 users watched her for a minute, she'd have 8000 w_minutes
    max_users:
    The max number of users this performer has performed for.
    avg_users: The average number of users this performer performs for.
    avg_duration: The average duration of this performers sessions
    max_duration: The longest session this performer has performed.

    current_session (not shown) If the performer is currently live then an additional object is provided with information about the current session. The only extra field in that is called user_delta which denotes how many viewers have joined / left the performance since the last check. More about that below.

    The fields in the recent_sessions objects are all pretty self explanatory given the above information, but only pertain to the session in question, the peak field is the minute index of when the user hit the most viewers for that session. The fields attached to the parent object are overall calculations which take into account all of the performers sessions, not just the recent ones.

    Sessions
    The final endpoint is /api/v1/performer/sexy_b0rsch/sessions/ which is a paginated response of all of the users sessions as there may be more than the five returned from the above call. There isn't anything special about this call, it does what it says on the tin.

    How it works:
    Chaturbate Affiliates will all know that there is already an API in place that you can use to get a data stream of information about online users. That's cool and all, but it's a really clunky system and also only returns users that are currently online. The Chaturbate API is updated every minute, so I made a simple cron job that pulls the information off this API every minute and runs it into a database, this way when a user goes offline, I still know about them as I've stored them, I can just mark them as offline.

    As the database is updated every minute, I am able to get (reasonably) fine grain information about sessions, number of users watching, length of sessions etc. And I record all of it into a DB for retrieval. My main motivation behind making this

    Future Plans:
    I'm in the works of introducing an 'achievements' section which will be granted to performers based on certain criteria and have them in tiers. And then making these achievements filterable and searchable.

    - Length of sessions
    - Average user count
    - Max user count
    - Watched Minutes count
    - Average length
    - Number of sessions played
    - Follower count

    etc.

    I haven't quite thought far enough ahead to consider how I'm going to make money from this. But we shall see.
     
    • Thanks Thanks x 1
  2. naughtynewell

    naughtynewell Regular Member

    Joined:
    Mar 24, 2013
    Messages:
    237
    Likes Received:
    77
    Update:

    I've added a few little extra bits on to the endpoints, particularly an extra object with a few details about the api deploy date and versioning.