apyhub
Back
▣ SMART GENERATION

Random Trivia, Quotes & Life Hacks API

What it does

Random Knowledge lets you fetch short, ready-to-use content from five endpoints: riddles, trivia, life hacks, quotes, and affirmations. Each response is a simple JSON object, so you can drop the result straight into a widget, homepage module, onboarding screen, or daily content feed.

The service provides random riddles, trivia, life hacks, quotes, and affirmations, with some endpoints offering optional parameters to control the type or length of content returned.

For quote flows, GET /retrieve-random-quote accepts optional max-length and min-length query values and returns a quote plus author. GET /retrieve-random-affirmation takes no input and returns an affirmation and an image field. All fields in the responses are nullable, so your client should handle empty values gracefully.

Random Knowledge is useful anywhere you want lightweight, human-friendly content without building your own content pipeline: a daily prompt in a product dashboard, a fresh onboarding card, a classroom activity, or a small engagement feature in a consumer app.

▣ ENDPOINT 01 / 05
GET
Random Riddle API
https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-riddle

QUICKSTART

GUIDE

Quickstart

Fetch a random riddle, optionally narrowing it by difficulty with a query parameter.

curl -X GET "https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-riddle?difficulty=easy" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with nullable string fields: answer, riddle, and difficulty.

{
  "answer": "Echo",
  "riddle": "What can you hear but never see?",
  "difficulty": "easy"
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Returns a random riddle as a JSON object. You can optionally filter the result by passing a difficulty query parameter.

Query Parameter(s)

AttributeTypeDescription
difficultyStringFilters the returned riddle by difficulty. Pattern: any single or multi-character string (.); maximum length is 6. by default easy

Response

Returns a JSON object with three nullable string fields: answer, riddle, and difficulty.

ParameterTypeDescription
answerStringThe riddle answer. Nullable.
riddleStringThe riddle text. Nullable.
difficultyStringThe difficulty of the returned riddle. Nullable.
▣ ENDPOINT 02 / 05
GET
Random Trivia API
https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-trivia

QUICKSTART

GUIDE

Quickstart

Fetch a random trivia string, optionally limiting its length with a query parameter.

curl -X GET "https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-trivia?max-length=300" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a trivia string field, which may be null if no trivia is available.

{
  "trivia": "The shortest complete sentence in English is often said to be: \"I am.\""
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves a random trivia string from the service. You can optionally limit the maximum trivia length with a query parameter.

Response

Returns a JSON object with a trivia string field. The field is nullable, so the response may contain a string value or null.

ParameterTypeDescription
triviaStringRandom trivia text returned by the service. Nullable.
▣ ENDPOINT 03 / 05
GET
Random Life Hack API
https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-life-hack

QUICKSTART

GUIDE

Quickstart

Fetch a random life hack, optionally limiting its length with a query parameter.

curl -X GET "https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-life-hack" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with nullable title and description string fields.

{
  "title": "Save time with this kitchen hack",
  "description": "Store herbs upright in a jar with a little water to keep them fresh longer."
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Returns a random life hack as a JSON object containing a title and a description. You can optionally limit the maximum length of the returned content with the max-length query parameter.

Response

Returns a JSON object with two nullable string fields: title and description.

ParameterTypeDescription
titleStringThe life hack title.
descriptionStringThe life hack description.
▣ ENDPOINT 04 / 05
GET
Random Quote API
https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-quote

QUICKSTART

GUIDE

Quickstart

Fetch a random quote, optionally narrowing it by minimum and maximum length using query parameters.

curl -X GET "https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-quote?max-length=300&min-length=120" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with two nullable string fields: quote for the quote text and author for the quote’s author.

{
  "quote": "The only way to do great work is to love what you do.",
  "author": "Steve Jobs"
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves a random quote and returns it as a JSON object with the quote text and author. You can optionally constrain the quote length using query parameters.

Query Parameter(s)

AttributeTypeDescription
max-lengthIntegerMaximum quote length in characters (1 to 10000). Default: 400, or 10000 when only a min-length above 400 is given.
min-lengthIntegerMinimum quote length in characters (1 to 10000). Default: 120, or 1 when only a max-length below 120 is given. A min-length greater than max-length returns 400; if no quote fits the range, the API returns 404.

Response

Returns a JSON object with two nullable string fields: quote and author.

ParameterTypeDescription
quoteStringThe quote text, or null if no quote is available.
authorStringThe author of the quote, or null if unavailable.
▣ ENDPOINT 05 / 05
GET
Random Affirmation API
https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-affirmation

QUICKSTART

GUIDE

Quickstart

Fetch a random affirmation.

curl -X GET "https://api.eu.apyhub.com/skycraft/random-trivia-quotes-life-hacks-api/retrieve-random-affirmation" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with two top-level string fields: image and affirmation. Both are nullable, so either may be null in the response.

{
  "image": "https://img.apileague.com/portrait-backgrounds/affirmation-147.png",
  "affirmation": "I am present in this moment."
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves a random affirmation and returns it in a JSON object. The response includes an image string field and an affirmation string field; both are nullable.

Response

Returns a JSON object with two nullable string fields: image and affirmation. The success response shape is an object; the schema does not define any additional fields.

ParameterTypeDescription
imageStringA string value, or null.
affirmationStringA string value, or null.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.