Skip to content

Instantly share code, notes, and snippets.

@strayge
Last active March 20, 2023 13:44
Show Gist options
  • Save strayge/300f560b3e89634838c729a103bcd55e to your computer and use it in GitHub Desktop.
Save strayge/300f560b3e89634838c729a103bcd55e to your computer and use it in GitHub Desktop.

API v4

базовый адрес: https://goodgame.ru/api/4/

ниже идут найденные методом тыка эндпоинты

для некоторых приведены примеры запроса,
для остальных они не известны и приведены коды ответов для запросов без параметров

/achievements/report                 POST 400
/achievements/<1>/map                GET  ачивки и ветки любого пользователя
/achievements/<1>/room               GET  расстановка трофеев пользователя
/achievements/<1>/pinned             GET  200
/chat/settings                       GET  403
/chat/settings                       POST 403
/clips                               GET  200
/comments?objId=<54678>&objType=<11> GET  комментарии
/complain                            GET  404
/cups                                GET  200
/dialogs                             GET  403
/favorites                           GET  список избранного текущего пользователя
/favorites/<5>                       GET  проверка наличия канала в избранном по ид канала
/favorites/subscribe                 POST {"obj_type":7,"obj":34490,"get_videos":0,"get_anons":0,"get_email":1}
/favorites2                          GET  ещё один список избранного (с другой структурой данных внутри стримов)
/forum                               GET  разделы и горячие темы с форума
/forum/<28>                          GET  раздел форума (?page=2)
/gallery                             GET  список галерей
/gallery/user/<1>                    GET  галереи пользователя
/games                               GET  список игр/жанров
/games/<3>                           GET  информация об игре по ид
/games2/<wow>                        GET  информация об игре по имени
/genres/<2>                          GET  информация о жанре по ид
/genres/<action>                     GET  информация о жанре по имени
/gifts/buy                           POST 400
/ggplus                              GET  403
/ggplus/upgrade                      POST 200
/ggplus/comments                     GET  200
/ggplus/avatars                      GET  200
/ggplus/donate                       POST 500
/ggplus/convert                      POST 403
/ggplus/level                        POST 403
/help                                GET  список разделов и страниц помощи
/help/article/<23>                   GET  страница помощи
/help/search?query=<текст>           GET  поиск по помощи
/index                               GET  топ стримов/тем на форуме/видео/новостей
/jobs                                GET  список челленжей текущего юзера
/jobs/forchat?user=<1>               GET  список челленжей для стрима другого юзера
/jobs/payment                        POST 403
/jobs/settings                       GET  500
/jobs/settings                       POST 403
/jobs/process                        POST 403
/license                             GET  какой-то jwt-токен
/login                               POST {"login":"name123","password":"pass456","remember":1}
/login/social                        GET  400
/login/password                      POST 200
/login/token                         POST 400
/mainpage/forum                      GET  200
/mainpage/mobile                     GET  200
/mainpage/clips                      GET  200
/mainpage/streams                    GET  200
/news                                GET  200
/partners/player                     GET  200
/payments/providers                  GET  200
/poll/<1>                            GET  200
/premium                             GET  200
/premium/                            GET  200
/premium/history                     GET  500
/premium/my                          GET  подписки текущего юзера
/premium/buy                         POST 200
/premium/gift                        POST 200
/rating                              GET  200
/recorder/all                        GET  список идшников
/recorder/<184>                      GET  true/false
/restreams/<chan_id>                 GET  статусы рестримов своего канала
/search                              GET  поиск по сайту (?section=<channels>&query=<miker>)
/shop                                GET  200
/shop/payment                        POST 200
/shop/options                        GET  200
/smiles                              GET  список всех смайлов с данными о них
/smiles2                             GET  список всех кодов смайлов
/stream                              GET  список стримов с фильтрацией (?ggonly=1&page=<1>&genre=<genre>&game=<game>&girls=1)
/stream/<Miker>/                     GET  информация о стриме
/stream/<Miker>/players              GET  html для встраивания плееров
/stream/selector                     GET  стримы на главной (?tab=<popular|cup|world-of-warcraft>&page=<2>&onPage=<12>)
/stream/games/                       GET  список игр
/stream/genres/                      GET  список жанров
/streams                             GET  список стримов (без каналов под галкой) (?page=<2>)
/topic/<1>                           GET  тема на форуме
/upload/image                        POST 500
/upload/editor                       POST 200
/upload/gif                          POST 500
/user                                GET  информация о текущем юзере (в т.ч. токен и jwt-токен)
/user/<1>                            GET  информация о любом юзере
/user/<1>/view                       GET  информация о любом юзере и его канале
/user/<1>/premiums                   GET  200
/user/blacklist                      GET  список каналов в черном списке
/user/stream-to-blacklist            POST {"id":1708} добавить канал в черный лист
/users/<miker>                       GET  информация о юзере и его канале по имени
/users/<1>                           GET  информация о юзере и его канале по ид
/users/<1>/nicknameChanges           GET  прошлые ники юзеров
/users/timezones                     GET  таймзоны
/users/connections/<uid>             GET  подключенные социальные сети (uid - ид текущего юзера)
/videos                              GET  список каких-то ютуб видео
/wallet2/<uid>/income                GET  данные о деньгах на ггшном счету (uid - ид текущего юзера)
/webpanel/webmaster/<uid>            GET  данные о текущем юзере из панели вебмастера (uid - ид текущего юзера)

/combinedRequest                     POST послать несколько запросов сразу
[
  {"url":"https://goodgame.ru/api/4/topic/111792","params":"","header":{"Accept":["application/json"]}},
  {"url":"https://goodgame.ru/api/4/comments?objId=111792&objType=11","params":"?objId=111792&objType=11",
  "header":{"Accept":["application/json"]}}
]

прочее

окно чата с авторизацией

https://goodgame.ru/chat/lokki7/?userid=&token=
где "id" и "token" - соответствующие поля из https://goodgame.ru/api/4/user/

ручки из js (не проверял на валидность)

POST   /ajax/moderation/unpublish                       unpublish
POST   /ajax/moderation/publish                         publish
POST   /ajax/moderation/delete                          delete

POST   clips/create/                                    createClip
POST   clips/crop                                       cropClip

GET    comments                                         getComments
POST   comments                                         sendComment
DELETE comments                                         deleteComment
POST   comments/undelete                                undeleteComment
GET    comments/page                                    _getPageComment

POST   complain                                         complain

GET    forum                                            index

GET    gallery/user/{!id}                               getGalleryForUserProfile
POST   gallery/{!albumId}/sort                          sortImages
POST   gallery/sort                                     sortAlbums
POST   gallery/{!albumId}/private                       changePrivacy
PUT    gallery/{!id}                                    changeTitle
GET    gallery/{!id}/obj                                getGallery
POST   gallery                                          createGallery
PUT    gallery/{!albumId}/{!photoId}                    saveEditingTitlePhoto
DELETE gallery/{!albumId}/{!photoId}                    deletePhoto
GET    gallery/{!id}/access                             hasAccess

GET    games/autocomplete/games                         query

GET    /ggplus/                                         currentSubscription
POST   /ggplus/convert                                  convertLegacy
POST   /ggplus/downgrade                                downgrade
POST   /ggplus/upgrade                                  upgrade
GET    /ggplus/avatars                                  loadAvatars
GET    /ggplus/comments                                 loadComments
POST   /ggplus/donate                                   plusDonate
DELETE /ggplus/comment/{!commentId}                     deleteComment
POST   /ggplus/comment/{!commentId}/undelete            unDeleteComment

POST   /gifts/buy                                       createPayment

GET    help                                             query
GET    help/section/{!sectionId}                        getSection
GET    help/article/{!articleId}                        getArticle
POST   help/section/{!sectionId}                        saveSection
POST   help/article/{!articleId}                        saveArticle
DELETE help/section/{!sectionId}                        deleteSection
DELETE help/article/{!articleId}                        deleteArticle
GET    help/search/?query={!searchQuery}                search

GET    jobs                                             getAllJobs
POST   jobs/process                                     process
POST   jobs/settings                                    setSettings1
GET    jobs/settings                                    getSettings
POST   jobs                                             createJob
POST   jobs/{!id}/goal                                  setGoal
POST   jobs/{!id}/pin                                   pin
POST   jobs/{!id}/unpin                                 unpin

POST   login/password                                   loginByPassword
POST   login/password/restore                           restorePassword
POST   login/password/code                              smsCode
POST   login/register/full                              registerByPassword
POST   login/register/token                             registerByUsernameAndToken
GET    login/social/info                                getSocialInfo

POST   moderation/get-ban-data                          getBanData
POST   moderation/make_warning                          makeWarning
POST   moderation/make_ban                              makeBan

GET    /news/{!id}                                      getArticle

POST   payments/pay                                     payment
GET    payments/providers                               getPaymentOptions
DELETE payments/provider/{!bindingId}                   deleteMethod

POST   poll/save                                        save
GET    poll/{!id}                                       getPoll
POST   poll/{!id}/vote                                  vote
POST   poll/{!id}/delete                                delete

POST   /premium/activate-free                           activateFreePremium
POST   /premium/buy                                     createPayment
POST   /premium/set-default-card                        setDefaultCard

GET    /premium/user/{!id}                              getPremiums

POST   rating                                           vote
GET    rating/voters/?objType={!objType}&objId={!objId} whoVoted

GET    rehost/streams                                   queryStreams
GET    rehost/                                          loadSettings
POST   rehost/                                          saveSettings
POST   rehost/list/add                                  addChannel
POST   rehost/list/delete                               deleteChannel

GET    /restreams/{!:streamId}                          getRestreamsAccounts
GET    /restreams/{!:streamId}/statuses                 getRestreamsStatuses
POST   /restreams/{!:streamId}/toggle                   toggleRestream
POST   /restreams/{!:streamId}                          saveRestream
DELETE /restreams/{!:streamId}                          deleteRestream

PUT    smiles/updateSort                                updateArraySmiles
GET    smiles/admin                                     getAdmin
GET    /smiles2/streamers                               getStreamers

GET    /streams/premium-settings?channel={!name}        getStreamerData
POST   streams/create                                   sendSms
POST   streams/code-check                               checkCode
POST   streams/donate                                   createPayment
GET    streams/donate-settings                          getSettings

GET    /streams/                                        getStreams
GET    /streams/games                                   getStreamsGames
GET    /streams/genres                                  getGenres
GET    /streams/{!key}                                  getStream
GET    /streams/{!key}/long                             getStreamLong
GET    /streams/by-user/                                getStreamsByUsers
POST   /streams/send-email                              sendLandingEmail

GET    topic/{!id}                                      get
GET    topic/{!id}/has-access                           hasAccess
POST   topic/save                                       save
POST   topic/{!id}/close                                close
POST   topic/{!id}/delete                               remove
POST   topic/{!id}/undelete                             undelete
POST   topic/{!id}/pin                                  fixTopic

GET    user/{!id}/view                                  get
GET    user/{!id}/premiums                              getPremiums

GET    /users/{!id}                                     getUser
GET    /users/{!id}/nicknameChanges                     getRussianNickName
GET    /users/{!id}/premiums                            getPremiums
DELETE /users/{!id}                                     deleteUser
GET    /users/free/{!username}                          checkIfUsernameIsFree
GET    /users/search/{!query}                           findUser
GET    /users/{!id}/nickname-history                    getNickNameHistory

GET    /users/countries?query={!query}                  autoCompliteCountry
GET    /users/cities?query={!query}                     autoCompliteCity
GET    /users/timezones                                 getTimeZones
POST   /users/{!id}/main                                updateMain
POST   /users/{!id}/more                                updateMore
POST   /users/{!id}/about                               updateAbout
POST   /users/{!id}/avatar                              saveAvatar
POST   /users/{!id}/background                          saveBackGround
POST   /users/{!id}/password                            savePassword
DELETE /users/{!id}/background                          deleteBackGround
DELETE /users/{!id}/avatar                              deleteAvatar

GET    users/@me                                        getUser

POST   /users/moderation/toggle-status                  deactivateUser
POST   /users/moderation/set-rights                     setUserRights

GET    wallet/order/available                           getAvailableAmount
POST   wallet/order/create                              createOrder
POST   wallet/order/sendsms                             sendConfirmSMS
POST   wallet/order/confirm                             confirmOrder

GET    /wallet2/{!id}/income                            getWalletData

GET    /webpanel/stats/{!id}{!startDate}{!endDate}      loadStats
GET    /webpanel/webmaster/{!id}                        loadWebmaster
GET    /webpanel/webmaster/{!id}/settings               loadSettingsOptions
POST   /webpanel/webmaster/{!id}/info                   saveWebmaster
POST   /webpanel/webmaster/{!userId}/settings           saveSettingsOptions

OAuth2

register app

https://goodgame.ru/user/<your_user_id>/oauth2

In examples below:
client_id = appname
redirect_uri = https://example.com/
secret = tcT1Su...I8QYG

user link

https://goodgame.ru/oauth2/authorize
	?state=123456
	&response_type=code
	&approval_prompt=auto
	&redirect_uri=https://example.com/
	&client_id=appname

redirect

success

https://example.com/
	?code=def50200b50...2a1dc73
	&state=123456

user not allowed access

https://example.com/
	?error=access_denied
	&state=123456
	&error_description=The+user+clicked+deny

get tokens with code

request

POST https://goodgame.ru/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type: authorization_code
client_id: appname
client_secret: tcT1Su...I8QYG
redirect_uri: https://example.com/
code: def50200b50...2a1dc73

response

{
    "token_type": "Bearer",
    "expires_in": 3600,
    "access_token": "eyJ0eXAiOi...tIbJaFig",
    "refresh_token": "def50200a0...71417f7f"
}

use access token

GET https://goodgame.ru/api/4/user/
Authorization: Bearer eyJ0eXAiOi...tIbJaFig

or

GET https://goodgame.ru/api/4/user/?access_token=eyJ0eXAiOi...tIbJaFig

refresh tokens

request

POST https://goodgame.ru/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type: refresh_token
refresh_token: def50200a0...71417f7f
client_id: appname
client_secret: tcT1Su...I8QYG

response

{
    "token_type": "Bearer",
    "expires_in": 3600,
    "access_token": "eyJ0eXAiOi...SYIWZWVw",
    "refresh_token": "def502e61f...57ee0e9e"
}

OAuth2 token without secret

link

https://goodgame.ru/oauth2/authorize
	?response_type=token
	&client_id=appname
	&redirect_uri=https://example.com/
	&scope=
	&state=654321

redirect

https://example.com/
	#access_token=eyJ0eXAiOiJKV1QiLCJhbG...g2AWD0H_X2rl5b_Wg
	&token_type=Bearer
	&expires_in=3600
	&state=654321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment