API Docs


Welcome to the API docs. These are the current versions available:

API Version 1

You need an API key which can be retrieved via mail. State your use case and expected API calls. Make sure you include this key in every request by using:

http://api.teamwork.tf/v1/action/parameter/?key=<Key-Here>

A fair use policy is applied on this API. Please be conservative on the amount of requests. If you make too many requests on daily basis (10.000+) your API key might become revoked unless you can prove it is neccesary for your service.

All methods

Response layout

By default all API requests will return a default layout. As long as you request correct URL you will always get an HTTP Status code 200 (OK). The response is always JSON in this format:

"code": 200,
"message": 
{ ... response information here ... }
The "code" value will return in the same manner of HTTP Status codes what the result of the request was. Examples are: 200 = OK, 404 = NOT_FOUND, 500 = BAD_REQUEST. The "message" value will return the response information (this can be an array, object or single value).

Object information

Creator profile:


YouTube Video:

GetCreators

Retrieve a list of YouTube Creators.

https://teamwork.tf/api/v1/?action=GetCreators
&type=(pub, comp or ani, optional)
&language=(for example English, optional)
&tag=(for example Humor, optional)
&main=(Scout, Soldier, Demoman etc. (first letter captial), optional)
&location=(For example Australia or Sydney, Australia, optional)
&orderByRank=(Boolean(true or false), optional)
&pageSize=(Int: by default 50, optional)
&page=(Int: by default 0, optional)
&key=<Key-Here>


Example:
https://teamwork.tf/api/v1/?action=GetCreators&key=MyGloriusKey

Example 2:
https://teamwork.tf/api/v1/?action=GetCreators&type=pub&key=MyGloriusKey

Example 3:
https://teamwork.tf/api/v1/?action=GetCreators&location=Australia&key=MyGloriusKey

Example 4:
https://teamwork.tf/api/v1/?action=GetCreators&main=Scout&key=MyGloriusKey

Response:
"code": 200,
"message": 
[
{
    "name": "Muselk",
    "youtube_acc": "UCd534c_ehOvrLVL2v7Nl61w",
    "twitch_acc": "muselk",
    "twitter_acc": "mrmuselk",
    "location": "Sydney, Australia",
    "type": "pub",
    "steam_group": "mrmuselk",
    "main": null,
    "subtitle": "Australian Gamer Youtuber!",
    "thumbnail": "https://yt3.ggpht.com/-iWlz7dePNz0/AAAAAAAAAAI/AAAAAAAAAAA/smtPKh-RLTU/s100-c-k-no/photo.jpg",
    "rank": 4,
    "website": null,
    "language": "English",
    "time_of_insert": "2015-11-09"
}
]

GetCreatorProfile

Retrieve all information about one YouTube Creator.

https://teamwork.tf/api/v1/?action=GetCreatorProfile
&id=(Teamwork ID, required)
&key=<Key-Here>
Teamwork ID is the Integer also used in the URL of a profile (such as https://teamwork.tf/profile/1/).

Example:
https://teamwork.tf/api/v1/?action=GetCreatorProfile&id=1&key=MyGloriusKey

Response:
"code": 200,
"message": 
{
    "name": "Muselk",
    "youtube_acc": "UCd534c_ehOvrLVL2v7Nl61w",
    "twitch_acc": "muselk",
    "twitter_acc": "mrmuselk",
    "location": "Sydney, Australia",
    "type": "pub",
    "steam_group": "mrmuselk",
    "main": null,
    "subtitle": "Australian Gamer Youtuber!",
    "thumbnail": "https://yt3.ggpht.com/-iWlz7dePNz0/AAAAAAAAAAI/AAAAAAAAAAA/smtPKh-RLTU/s100-c-k-no/photo.jpg",
    "rank": 4,
    "website": null,
    "language": "English",
    "time_of_insert": "2015-11-09"
}

GetVideoFeed

Get the videofeed as presented on teamwork.tf (which are only the videos that are classified as TF2 and not the other videos).

https://teamwork.tf/api/v1/?action=GetVideoFeed
&type=(pub, comp or ani, optional)
&language=(for example English, optional)
&tag=(for example Humor, optional)
&creator_id=(Teamwork ID, optional)
&pageSize=(Int: by default 50, optional)
&page=(Int: by default 0, optional)
&includeCreator=(true|false, optional (default is false))
&key=<Key-Here>


Example:
https://teamwork.tf/api/v1/?action=GetVideoFeed&key=MyGloriusKey

Example 2:
https://teamwork.tf/api/v1/?action=GetVideoFeed&type=pub&key=MyGloriusKey

Example 3:
https://teamwork.tf/api/v1/?action=GetVideoFeed&tag=Humor&includeCreator=1&key=MyGloriusKey

Example 4:
https://teamwork.tf/api/v1/?action=GetVideoFeed&creator_id=1&key=MyGloriusKey

Response:
"code": 200,
"message": 
[
{
    "creator_id": 129,
    "videoid": "9eEOlRAVIwA",
    "title": "Comp.tf - Backcap #3 Week of 16-22 November",
    "published": "2015-11-22 09:01:28",
    "views": 605,
    "likes": 88,
    "dislikes": 0,
    "comments": 14,
    "hq_available": true,
    "duration": 513
},
...
]
If includeCreator=1 is added to the URL, a property creator will be in each YouTube item with the corresponding creator.

GetRandomPickOfToday

Get the current RandomPickOfToday including the profile information.

https://teamwork.tf/api/v1/?action=GetRandomPickOfToday&key=<Key-Here>


Response:
"code": 200,
"message": 
{
    "id": 14,
    "creator_id": 275,
    "time_of_insert": "2015-11-22",
    "creator": 
    {
        "name": "TF2Captain",
        "youtube_acc": "UCbLEkKxEL5mmF4cOgvQmA1A",
        "twitch_acc": "TF2Captain",
        "twitter_acc": "TF2Captain",
        "location": "Maryland, United States",
        "type": "pub",
        "steam_group": "CaptainsCompany",
        "main": null,
        "subtitle": "Bringing you everything Team Fortress 2, from game mods to unboxings as well as duels and much more! ",
        "thumbnail": "https://yt3.ggpht.com/-9sGldLo1Bc0/AAAAAAAAAAI/AAAAAAAAAAA/TmCe2Ho_wJk/s100-c-k-no/photo.jpg",
        "rank": 294,
        "website": null,
        "language": "English",
        "time_of_insert": "2015-11-09"
    }
}

GetRandomPickHistory

Get last 50 RandomPick Creator IDs (including the RandomPick Creator of today).

https://teamwork.tf/api/v1/?action=GetRandomPickHistory&key=<Key-Here>


Response:
"code": 200,
"message": 
[
{
    "id": 1,
    "creator_id": 275,
    "time_of_insert": "2015-11-21"
},
...
]

GetTF2Servers

Retrieve all Valve TF2 server farms and their locations (as used on the map).

https://teamwork.tf/api/v1/?action=GetTF2Servers&key=<Key-Here>


Response:
"code": 200,
"message": 
[
{
    "id": 2,
    "type": "pub",
    "valve": true,
    "name": "Stockholm, Sweden",
    "location": "(59.3276898,18.0406043)"
},
...
]