rbxweb

package module
v0.0.0-...-c9276a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2025 License: GPL-3.0 Imports: 16 Imported by: 2

README

rbxweb

Godoc Reference

Go package that provides access to hand-picked Roblox web-based APIs.

To see which APIs have been implemented, see the services/ folder.

No tests are performed, and stability is not guranteed; this API is susceptible to breaking changes from both Roblox and code changes.

Example
client := rbxweb.NewClient()
cv, err := client.ClientSettingsV1.GetClientVersion(clientsettings.WindowsPlayer, "")

Documentation

Overview

Package rbxweb provides API routines to interact with Roblox's web API.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadStatus = errors.New("bad status")
	ErrNoData    = errors.New("no data")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	http.Client
	BaseDomain string

	Security string
	Token    string

	Services
	// contains filtered or unexported fields
}

Client embeds an http.Client, used to make Roblox API requests.

BaseDomain is the URL domain used to execute calls to, in case an alternative domain is given.

func NewClient

func NewClient() *Client

NewClient returns a new Client.

func (*Client) BareDo

func (c *Client) BareDo(req *http.Request) (*http.Response, error)

BareDo will execute the given HTTP request, leaving the response body to be read by the user. If any error occurs, the respose body will be closed. If a API error response is available, it will be returned as ErrorsResponse or string for undocumented APIs, otherwise, a StatusError will be returned.

If Roblox set a ROBLOSECURITY cookie or a X-CSRF-TOKEN header, it will always be used in future requests.

func (*Client) Do

func (c *Client) Do(req *http.Request, v any) (*http.Response, error)

Do will perform the given HTTP request on the client, and will write the response body as necessary to v, if non-nil. In any case, the response will always be returned as it is with a resulting error, if any. The response body of the HTTP request is always going to be closed.

func (*Client) Execute

func (c *Client) Execute(method, service, path string, body any, v any) error

Executes creates a new Request with NewRequest and the given parameters and immediately executes it with Do, which unmarshals the response body to v, if any.

func (*Client) NewRequest

func (c *Client) NewRequest(method, service, path string, body any) (*http.Request, error)

NewRequest returns a new http.Request, with a path that will be relative to the BaseDomain of the client, and a service - which can be empty, to indicate the microservice to use. If body is specified, it will be interepreted as JSON encoded and will be added to the request body.

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Field   string `json:"field,omitempty"`
}

ErrorResponse implements the error response model of the API.

func (ErrorResponse) Error

func (err ErrorResponse) Error() string

Error implements the error interface.

type ErrorsResponse

type ErrorsResponse struct {
	Errors []ErrorResponse `json:"errors,omitempty"`
}

errorsResponse implements the errors response model of the API.

func (ErrorsResponse) Error

func (errs ErrorsResponse) Error() string

Error implemements the error interface.

func (ErrorsResponse) Unwrap

func (errs ErrorsResponse) Unwrap() error

Unwrap implements the Unwrap interface by returning the first error in the list.

type Services

type Services struct {
	ThumbnailsV1     *thumbnails.ThumbnailsServiceV1
	UsersV1          *users.UsersServiceV1
	AuthTokenV1      *token.AuthTokenServiceV1
	AuthV1           *auth.AuthServiceV1
	ClientSettingsV1 *clientsettings.ClientSettingsServiceV1
	GamesV1          *games.GamesServiceV1
	LegacyV1         *legacy.LegacyServiceV1
}

Services is the list of implemented Roblox Web APIs

type StatusError

type StatusError struct {
	StatusCode int
}

StatusError represents an unexpected HTTP error, in the case that a ErrorResponse was unable to be parsed.

func (*StatusError) Error

func (e *StatusError) Error() string

Directories

Path Synopsis
cmd
internal
api
services
auth
clientsettings selectively implements the 'auth' Roblox Web API.
clientsettings selectively implements the 'auth' Roblox Web API.
clientsettings
clientsettings selectively implements the 'clientsettings' Roblox Web API.
clientsettings selectively implements the 'clientsettings' Roblox Web API.
games
games selectively implements the 'games' Roblox Web API.
games selectively implements the 'games' Roblox Web API.
legacy
package legacy selectively implements undocumented legacy Roblox Web APIs
package legacy selectively implements undocumented legacy Roblox Web APIs
thumbnails
thumbnails selectively implements the 'thumbnails' Roblox Web API.
thumbnails selectively implements the 'thumbnails' Roblox Web API.
token
token partially implements the undocumented auth-token-service API.
token partially implements the undocumented auth-token-service API.
universes
Package universes implements types for interfacing with Roblox Universes.
Package universes implements types for interfacing with Roblox Universes.
users
clientsettings selectively implements the 'users' Roblox Web API.
clientsettings selectively implements the 'users' Roblox Web API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL