justintv / twitch-api Goto Github PK
View Code? Open in Web Editor NEWA home for details about our API
Home Page: www.twitch.tv
A home for details about our API
Home Page: www.twitch.tv
I am using php for getting the proper info from the api but when the page with the streams loads it take sooo much time.
Is there any other way (faster) to get the info of a stream?
How do you use /channel/CHANNELNAME/Commercials post with JS api ?
I'm using the following command to update the stream title:
curl -H "Authorization: OAuth [authvalue]" -X PUT -d 'channel[status]=NEW STATUS' https://api.twitch.tv/kraken/channels/[channelname]/
Which successfully updates the stream title here (in the title box):
http://www.twitch.tv/broadcast/dashboards/[channelname]
However, the actual stream title on the
http://www.twitch.tv/[channelname]
Page does NOT update. To force this I must then click the UPDATE button on:
http://www.twitch.tv/broadcast/dashboards/[channelname]
Additionally, the api returns the updated data when querying channel information.
Having a call that returns whether a given user is following a given stream or not would be extremely useful. Having to traverse the whole list with several calls is not optimal.
My use case for this would be stream giveaways (only followed users gets to participate)
I have the token I just don't know how to change the channel status, you don't give a very good documentation.
I'm using JavaScript to POST to a PHP file then the PHP file is supose to send the data to change the status, but it doesn't seem to be working can someone give me working php code example?
Upon connection the server sends the following message (among others) to the connecting client:
004: tmi.twitch.tv 0.0.1 w n
The message states that the server supports users as Wallops and that no external messages can be sent to channels. The server may support these, but that's not my concern; my concern is what modes are left out of the message. For example, the server supports mode o
(users becoming channel operators) and possibly many others.
On a side note: These could also be added into a 005 RPL_ISUPPORT
response, which helps newer clients interact with a server and determine its limitations on the user, such as max # of channels one can join.
The API lacks this capability the old one has, which is to give a set amount of channels in a param and have it return a summary of the set's current viewer count, and the amount of live channels from the set. Offline channels in the set would here be counted as 0.
The old API uses the param "channel", which can be just one channel or a comma separated list of several channels.
For me personally, this functionality provides key insight into statistics that would otherwise be hard to get to if each channel had to be queried individually, as the amount of requests wouldn't scale well.
Figured both of these could be lumped into the same issue since they are the inverse of each other. I've talked to Josh about this some already, but I supposed it's good to put the idea in the list for record's and discussion's sake.
Public Channel needs the ability to get a list of that channel's followers. I'm not sure the logistics the ability for the auth'd channel to get the entire list at once since we do have some pretty large channels and a 10-30k object result via json would probably kill someone.
Public user needs the ability to get that user's list of favorite channels. Since this would be public and to avoid possible abuse, limiting to 100 max like everything else works.
Authenticated user needs the ability to get that user's entire favorite's list in one chunk ( Or chunks of 500-1000 at least? ) , abuse should not be a big problem as it's an authenticated request.
Currently missing from the users command, this should provide a profile link for external applications.
It looks like part of the cache bug described in #8 is back.
Updating the "status" and "game" fields via PUT on https://api.twitch.tv/kraken/channels/:channel reflects in JSON and in the dashboard. However, those changes do not display on http://twitch.tv/:channel, or take ages to do so.
Describing the problem is difficult, so let me know if you need any additional details. Thank you.
The User resource shows whether or not a user is Staff, but not whether they are an Administrator. An item with this value should be added to the User resource.
A list of all teams would be a great help. There is a method to get the data for a specific team, but I could not figure out which teams are available.
This might not be API-specific, as it's about embedding streams and chat on websites, but it's relevant and she be mentioned somewhere on these docs. To get it working for my own project, I had to check the source of various websites that had stream embeds to get an idea of what I needed to do.
Also on the embedding topic, info on the ExternalInterface functions that can be called on the stream object would be helpful. The JustinTV API has a pretty extensive page on the topic, and I found that only mute() and unmute() worked for the TwitchTV embed.
In java, currently I am PUT-ting channel[status]=TEST, for example, to update the status of a stream, but it always returns 400 bad request - I presume this is because I'm not putting the right data from my app, but I'm not sure.
Thanks
I'm trying to get a list of subscriber only emotes, but the output of the chat resource seems to be exactly the same no matter what channel or parameters I pass to it. Channels that I know have subscriber only emotes never show up in the list.
https://api.twitch.tv/kraken/chat/lethalfrag/emoticons
https://api.twitch.tv/kraken/chat/cosmowright/emoticons
https://api.twitch.tv/kraken/chat/teamsp00ky/emoticons
etc.
neither limit nor offset parameters seem to do anything either.
In fact, the only channel I can find that shows even a single subscriber only emote is the test user in the example, and it's just that, a single emote.
I'm not sure if I'm doing something wrong ( Not sure how I would be considering it doesn't work in-browser ), or if the resource is bugged.
Since this is no longer supported via IRC in TMI, having this call would be great.
Having this available so the channel owner won't have to replicate the list again would be ideal.
I'd like to use it like a list of trusted users for a channel, giving the user entries additional permissions.
One thing the API is currently lacking is a way to list users currently watching a stream.
A call to get all people currently in a chat would probably be sufficient. Additionally it would be nice to have all the usergroup data associated with each user i.e. Moderator, Pro, Subscriber, all of the above etc. since as far as I can tell there's no way to scrape this from the IRC channels.
Reposting from the Twitch support forums as I was post this here instead.
Attempting to update a channel's "status" and "game" as outlined here does not behave as expected. While the returned JSON suggests both have been changed, only the current game actually changes. Additionally, while further requests to the API reflect this change, the page itself, http://twitch.tv/:channel, does not. It only actually updates in the dashboard, where you can force it to update, defeating the purpose of having API functionality for it altogether.
tl;dr, your https://api.twitch.tv/kraken/channels/:channel PUT functionality does not work.
I could really use a channel search functionality that lets me search for channels/streams by a text string (which would search display_name, status, and potentially team display_names as well). I'd also like to be able to specify a game filter, to only retrieve results within a specific game (or multiple games if possible).
Basically, something like this, except with API-formatted results:
http://www.twitch.tv/search?query=tsm
Apology if this is a double post, I wasn't able to see my previous
post.
I found duplicates on ONE page (http://api.justin.tv/api/stream/
list.xml?category=gaming&limit=100&offset=99) using no code, showing
me that there is in fact an issue with Twitch's API.
Copy+Pasta with instructions:
http://pastebin.com/JpXAx3ck
Essentially ctrl+F, then look for "deathhand2277", watch the
scrollbar, and keep pressing the "Next" button until you see the
scrollbar jump to the next record (will take 17 clicks).
There's two records that are exactly the same! Off one page request
from Twitch!
I'd like to get a channels video banner image and a 16:9 channel preview image via the api. Currently you can only retrieve their 300x300 "logo", channel banner and such.
ref: https://groups.google.com/d/topic/justintv-api-developers/Etyd8KapURk/discussion
The logo returned for a user through the RESTful API, described at https://github.com/justintv/Twitch-API/blob/master/resources/users.md, is 300x300. For web sites that display a list of Twitch users with their logos next to them, it would be useful to host smaller versions like 32x32 and 64x64. (These are the sizes offered by Steam; see the "avatar" values at
https://developer.valvesoftware.com/wiki/Steam_Web_API#Public_Data)
There is no easy way of determining what channel a subscriber only emotes correlates to. There is "emoticon_set" but I can't find any way to resolve that into a channel name.
Currently the only place the channel name appears is in the image URL (ex chansub-leveluplive-emoticon-82766be671bb475c-70x30.png) but not all subscriber emotes follow this pattern (ex chansub-global-emoticon-ef97c4770222476c-23x30.png).
Having a compact list of followers for a channel would be great.
Preferably with offset and limit parameters.
In the old JTV api you could see the embed count for a given stream e.g.
http://api.justin.tv/api/stream/list.json
as embed_count. I can't find this information on the new Twitch API. This is a nice stat to have as it is clear that games that get consistently more viewers like LoL and SC2 have a healthy percentage of their viewers coming from embeds.
When can we expect the RESTful Integration Guide to be updated?
A user that has been given editor privileges should be able to authenticate, and retrieve subscription lists from the channel they have been given access to.
When I currently do it. I get the following 403 error. "The current authorization is not valid for this context".
When trying to update the channel status via Twitch API, I get a 200 response (which should tell me everything is OK), but the returned object clearely shows the status not being updated.
curl -i -X PUT -H 'Authorization: OAuth 8739tkrwswxmfwhsr9l91iqqx' -H 'Accept: application/vnd.twitchtv+json' https://api.twitch.tv/kraken/channels/yegwenterraria -d'game=ThisDoesNotChange'
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 10 Sep 2012 13:37:01 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 853
Connection: close
status: 200 OK
via: Twice 0.2 web10:3346
x-runtime: 0.325780
x-ua-compatible: IE=Edge,chrome=1
cache-control: max-age=0, private, must-revalidate
x-geo: PL
Front-End-Https: on
{"game":"Terraria","name":"yegwenterraria","created_at":"2011-12-26T20:26:21Z","teams":[],"banner":null,"updated_at":"2012-09-10T11:48:15Z","background":null,"url":"http://www.twitch.tv/yegwenterraria","_links":{"stream_key":"https://api.twitch.tv/kraken/channels/yegwenterraria/stream_key","self":"https://api.twitch.tv/kraken/channels/yegwenterraria","chat":"https://api.twitch.tv/kraken/chat/yegwenterraria","commercial":"https://api.twitch.tv/kraken/channels/yegwenterraria/commercial","videos":"https://api.twitch.tv/kraken/channels/yegwenterraria/videos","features":"https://api.twitch.tv/kraken/channels/yegwenterraria/features"},"logo":"http://static-cdn.jtvnw.net/jtv_user_pictures/yegwenterraria-profile_image-d05171c54c54222e-300x300.png","_id":27043165,"mature":null,"video_banner":null,"display_name":"YegwenTerraria","status":"Inny temat"}
When I set the Twitch logo to the bottom right, then try to change the quality settings (to the lowest quality, which overlaps the logo), often times the flash app believes I'm actually clicking on the logo, redirecting me to twitch.tv/streamName instead of changing the quality.
The authenticated user would do well with the ability to see if they are email-verified or not ( Just a simple bool I guess )
https://api.twitch.tv/kraken/streams returns streams ordered by viewer count.
My goal is to get streams with low viewer count. As the limit of returned streams is 100, I get way too much TOP-streams.
Two possibilities in my opinion:
I want to be able to have a program that does something when a specified user's stream goes live. Specifically, I have an IRC Bot that I would like to have notify the channel when the user scglive
starts streaming.
I posted on the mailing list about the issue1 and was told to post an issue here about it.
It appears that this is possible with the legacy API2.
Having a scope (null scope or whatever) for just authenticating a user would be nice. This way I don't have to force them to give up their email just to authenticate with my service.
(Currently using the user_read scope and reading the username from /user)
It would be nice if you added the embedcode property to the stream object as in justin.tv api.
Currently there's no way to tell what user created a highlight, the owner on a video is set to the channel the highlight was made from ( that's correct ), but there's no way to tell who created highlight clips.
Adding the creator's channel to links ( which would be either null or the same as the owner for standard VODs since they "created" their own clip automagically ) seems like the logical thing to do.
I currently have little knowledge about the allowed amount of API requests per minute, and I don't dare spam the API to find out in case of IP black-listing. It would be very helpful to include some information about this in these docs, including an example of what the API would return if the rate limit was exceeded.
not sure if this is by design, or an oversight
I grab streams by using https://api.twitch.tv/kraken/streams
Didn't see any possibility to get the short or long bio for the user/channel on any type of request.
It would be very nice if we could get that info in the same response.
Looking at http://www.twitch.tv/broadcast/dashboard/stats shows that, under commercials played, none are recorded that are played through the API. This applies to both the old API and the new API i believe.
This has led to some users being unsure how many commercials were played during a period and how to judge their revenue.
Getting easy access to a list of the subscribers on a channel would be great. Having to listen in on chat to tell if a user is a subscriber or not isn't exactly optimal.
Having this available through the API so scraping can be avoided would be great.
Channels supports JTV channels, Streams does not ( Intentional ), and there is no way to tell via Kraken if a channel is a Twitch or Justin channel.
Since categories are not coming back ( Twitch has only one category! ), it would be nice to have a simple way to tell if a channel is JTV or TTV.
Use Case: Scripts can determine if they need to shoot off a call to the JTV api if the channel is not a Twitch channel.
Side note: do you think it would be worth changing the return value of the Streams resource if the channel is not a Twitch channel to differentiate from channels that are simply offline? Or is that not something the api should have to deal with?
I frequently receive HTTP error 400 responses from the API to what seem to be well-formed HTTP requests sent through cURL. Every time I've checked the API call manually by copying that exact API URL into a browser (Firefox) immediately after having received the 400 response through cURL, I get the expected data returned with an HTTP 200 response (i.e. I've never seen the 400 response while testing the API in a browser).
In addition, I have only ever received the 400 response when the "offset" GET parameter was set to 1600 or higher (e.g. 1700, etc.). When I start seeing the 400 errors on these high-offset calls, it seems they happen for hours at a time, although there will also be "good" (i.e. HTTP 200) responses to the same high-offset calls mixed in during that time as well. Then there will be hours (or days) at a time where I do not see a 400 response.
This is an example of the raw HTTP request header sent from cURL that (sometimes) receives the 400 response:
GET /api/stream/list.json?category=gaming&limit=100&offset=1600 HTTP/1.1
Host: api.justin.tv
Accept: /
Accept-Encoding: gzip
It would be a very good addition to Channels to be able to list, add, edit, remove, and reorder panels in the new design. I realize the new design is in beta, but that's the best time to start asking for additions of this type.
GET /channels/:channel/panels/
GET /channels/:channel/panel/:id/
GET /panel/:id/ ( ?.. Maybe not? )
Authenticated:
POST /channels/:channel/panels/ ( Content, Type, Position | More than one panel at once? )
PUT /channels/:channel/panel/:id/ ( For updating a specific panel )
Position should probably work like it does on the site, popping it out at that point, placing it at whatever position and incrementing the position of all other panels.
If I do something like:
https://api.twitch.tv/kraken/channels/steven_bonnell_ii/subscriptions/1337hephaestus
I would expect to have to provide the :user's token and get a response indicating whether or not I was subscribed to Destiny.
However, the subscriptions resource now works more like a subscribers resource, in that it depends on the :channel's auth token, and tells the channel whether or not a user is a subscriber, (or at the root resource, lists the subscribers of a particular channel).
If this is the intended behavior of this resource, then the docs don't make it very clear
eg: 'Check if user is subscribed to channel'
with
curl -i https://api.twitch.tv/kraken/channels/hebo/subscriptions/testuser
could return
'testuser has no subscriptions to hebo'
but it's not obvious that we actually need hebo's token to check if testuser is a sub
image if both testuser and hebo have a sub button, and hebo was subscribed to testuser
which path would give us an error, and which path would identify that hebo is in fact subbed to testuser? And who's token do we need to use? As of now, it's not very clear.
https://api.twitch.tv/kraken/channels/hebo/subscriptions/testuser
https://api.twitch.tv/kraken/channels/testuser/subscriptions/hebo
https://api.twitch.tv/kraken/channels/testuser/subscriptions/hebo
with testuser's auth token would be the only way to find out if hebo is subscribed to testuser
my suggestion:
either clarify the docs to indicate the auth direction and the intent of the system, or allow users to reveal who they are subscribed to
for example:
https://api.twitch.tv/kraken/users/1337hephaestus/subscriptions
could list who I am subscribed to, and
https://api.twitch.tv/kraken/users/1337hephaestus/subscriptions/steven_bonnell_ii
would tell me if I am subscribed to Destiny
OR change the current subscriptions resource to subscribers because it makes more semantic sense given the auth direction
something like
https://api.twitch.tv/kraken/users/1337hephaestus/follows/channels/gomtv
would make sense
e.g.:
https://api.twitch.tv/kraken/users/1337hephaestus/subscribes/channels/gomtv
https://api.twitch.tv/kraken/users/1337hephaestus/subscribes/channels
https://api.twitch.tv/kraken/streams/subscribed
could also be a thing (like /streams/followed)
The new follows API is excellent, however, in order to use it to determine if any followed streams are active, each follow needs to be queried on the stream API to see if it is active or inactive. Users who have a large amount of follows would take a really long time to query this information and use up a bunch of API requests each time. It would be quite a bit more efficient if either a) a filter is added to allow pulling only streaming follows (ie: ?stream=true on query), or b) adding an entry in the follows.channel object named "stream" which is true or false if the stream is active or inactive.
When i load up a live stream all i get is a black screen for every stream i join its just black screened :(
ae
Currently the order of videos returned by the video resource API is random. To demonstrate make few calls to the following API:
https://api.twitch.tv/kraken/channels/nugiyen/videos
Observe each time different video will be on the top.
It is preferable to have a list of video in some sort of order (say by recorded date). It will be even better if we can ask the API to order by a specified attribute like recorded date or views.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.