# Best way to get Oauth token for API

**URL:** <https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386>\
**Category:** API\
**Created:** [September 14, 2016, 11:36pm UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386 "2016-09-14T23:36:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GaryTheCoolGuyIII](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@GaryTheCoolGuyIII](https://discuss.dev.twitch.com/u/GaryTheCoolGuyIII)\
**Post date:** [September 14, 2016, 11:36pm UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386/1 "2016-09-14T23:36:10Z")

</div>

Hello. I have been working on a chat bot for quite awhile now, and recently I have taken the plunge to give the bot access to Twitch and other API’s. The issue I have come up with is that it seems like in order to get an Oauth token in order to make authorized requests, I need a redirect URL… My bot has no site, I own/host no sites, and I have absolutely no experience with anything more than the mere basic HTML and such. What is the easiest way to get an Oauth token despite this difficulty?

---

<div class="post-metadata">

**Author:** ![ceriath](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/ceriath/32/1547_2.png) [@ceriath](https://discuss.dev.twitch.com/u/ceriath)\
**Post date:** [September 15, 2016, 1:43am UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386/2 "2016-09-15T01:43:34Z")

</div>

use [http://localhost](http://localhost) and extract it from the url. you could do that easily with some basic php, javascript, or just ask google about it, there is a bunch of examples 🙂

---

<div class="post-metadata">

**Author:** ![3ventic](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/3ventic/32/298_2.png) [@3ventic](https://discuss.dev.twitch.com/u/3ventic)\
**Post date:** [September 15, 2016, 3:18am UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386/3 "2016-09-15T03:18:19Z")

</div>

Using the Twitch js sdk on github pages is simple and free.

---

<div class="post-metadata">

**Author:** ![GaryTheCoolGuyIII](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@GaryTheCoolGuyIII](https://discuss.dev.twitch.com/u/GaryTheCoolGuyIII)\
**Post date:** [September 15, 2016, 7:11pm UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386/4 "2016-09-15T19:11:42Z")

</div>

As I stated in the OP: I don’t host a site, I don’t know PHP or Javascript, and all my googling has found examples that involve some sort of site, but like I said, since this is a one-off personal bot, I don’t have any sort of site or tools like that.

---

<div class="post-metadata">

**Author:** ![george](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/george/32/120_2.png) [@george](https://discuss.dev.twitch.com/u/george)\
**Post date:** [September 15, 2016, 9:20pm UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386/5 "2016-09-15T21:20:44Z")

</div>

Absolutely easiest would be [https://twitchapps.com/tokengen/](https://twitchapps.com/tokengen/). I created this website for one-off token requests when I need them.

---

<div class="post-metadata">

**Author:** ![GaryTheCoolGuyIII](https://avatars.discourse-cdn.com/v4/letter/g/eb8c5e/32.png) [@GaryTheCoolGuyIII](https://discuss.dev.twitch.com/u/GaryTheCoolGuyIII)\
**Post date:** [September 17, 2016, 1:21pm UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386/6 "2016-09-17T13:21:40Z")

</div>

Thank you. I was looking specifically for something like this. Something super easy to input everything and get what I need.  
Also appreciate you using the implicit flow.  
Give this man a cookie… platter… with a server…

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [October 17, 2016, 1:21pm UTC](https://discuss.dev.twitch.com/t/best-way-to-get-oauth-token-for-api/7386/7 "2016-10-17T13:21:41Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
