Client
The main class to interact with API.
Attributes
api_key
api_keyThis your API authentication key.
Type: str
As of version 3, The API key is required to use the API. Get one from here.
version
versionThe version of API to use. This defaults to "4"
Type: str
suppress_warnings
suppress_warningsDetermines if version or other warnings will be shown in console or not. Set this to True to stop warnings.
Type: bool
Methods
get_ai_response
get_ai_responseGets random AI response.
These are parameters for version 4.
message
messageThe message to which the response is required.
Type: str
plan (Optional)
plan (Optional)The plan to use for AI response.
Type: str
This must be one of from the plans list.
language (Optional)
language (Optional)The language of returned response. This defaults to en. 
Type: str
server (Optional)
server (Optional)The server from which the response should be received. This defaults to primary. Set it to backup if the primary is down. Don't use unstable as it is quiet unstable.
Type: str
master (Optional)
master (Optional)The developer's name. Used in responses. Defaults to PGamerX This is basically what bot will say on "Who is your creator?" or related questions.
Type: str
bot (Optional)
bot (Optional)The bot's name. This is used in responses. Defaults to RSA. This is basically what bot will say on "Who are you?" or "What is your name?" or related questions.
Type:str
uid (Optional)
uid (Optional)The unique ID. This is used to create a separate session. Read Unique ID page for more info.
Type: str
Below arguments are specific to version 3.
message
messageThe message to which the response is required.
Type: str
plan (Optional)
plan (Optional)The plan to use for AI response.
Type: str
This must be one of from the plans list.
lang (Optional)
lang (Optional)The language of returned response. This defaults to en. 
Type: str
type (Optional)
type (Optional)The server from which the response should be received. This defaults to stable. Don't use unstable as it is quiet unstable.
Type: str
dev_name (Optional)
dev_name (Optional)The developer's name. Used in responses. Defaults to PGamerX This is basically what bot will say on "Who is your creator?" or related questions.
Type: str
bot_name (Optional)
bot_name (Optional)The bot's name. This is used in responses. Defaults to RSA. This is basically what bot will say on "Who are you?" or "What is your name?" or related questions.
Type:str
unique_id (Optional)
unique_id (Optional)The unique ID. This is used to create a separate session. Read Unique ID page for more info.
Type: str
The response as a AI response object.
Type: AIResponse
randomstuff.BadAPIKey: The API key provided was invalid.
randomstuff.PlanNotAllowed: The plan is not available on your account because you haven't bought it.
randomstuff.InvalidPlanError: Provided plan was invalid
randomstuff.InvalidServerError: The server is either not responding or invalid.
get_image
get_imageGets a random image.
type(Optional)
type(Optional)The type of image. This is one of the types from image types. Defaults to any.
Type: str
The image imgur link as a string.
Type: str
randomstuff.AuthError: The API key provided was invalid.randomstuff.InvalidArgument: The image type was not valid.
get_joke
get_jokeGets a random joke.
randomstuff.BadAPIKey: The API key provided was invalid.
randomstuff.InvalidArgument: The joke type was not valid.
get_waifu
get_waifuGets a random waifu/anime image URL.
type
typeThe type of anime. Can be one from Anime Types
Type: str
plan
planThe plan to use. Can be one from Plan Types
Type: str
randomstuff.BadAPIKey: The API key provided was invalid.
randomstuff.InvalidArgument: The waifu type was not valid.
randomstuff.PlanNotAllowed: The plan is not available on your API key.
get_weather
get_weatherGets the weather of provided city.
close
closeCloses a session.
Last updated
Was this helpful?