PUBLIC API

Random Compliment API

SHARE THIS ARTICLE
Word Checker Public APIs
By Stephen Lunt 27 MAY 2025

The random compliment API can be used to generate a compliment at random from a list containing 1000’s of compliments across various categories.

On this page

Consuming the API

  • Navigate to the Word Checker Rapid API page.
  • You will need to setup a Rapid API account and application to use our APIs. We offer a free subscription package on Rapid API, however, you may need to switch to a paid subscription if your application traffic grows.
  • Click on the /v1/generator/random-compliment section.

Endpoint Open API Specification

openapi: 3.0.4

info:
  title: Word Checker Service
  description: API of word tools such as anagram solvers, random word generators, and more.
  version: 1.0.0

paths:
  /v1/generator/random-compliment:
    get:
      summary: Random Compliment Generator
      parameters:
        - name: category
          in: query
          description: The category of the compliment (defaults to any category)
          required: false
          schema:
            type: string
            enum:
              - friends
              - mother
              - father
              - sister
              - brother
              - colleagues
      responses:
        "200":
          description: A JSON object containing the random compliment
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RandomComplimentResponse"
        "400":
          $ref: "#/components/responses/ErrorResponse"
        "429":
          $ref: "#/components/responses/TooManyRequests"

components:
  responses:
    ErrorResponse:
      description: A generic error responses with error code and hint
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                description: The error code
                type: string
                example: ERROR_CODE
              error_hint:
                description: A hint to resolve the error
                type: string
                example: Error hint
            required:
              - error
              - error_hint
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                description: The error code
                type: string
                example: TOO_MANY_REQUESTS
              error_hint:
                description: A hint to resolve the error
                type: string
                example: You're making requests a bit too quickly. Please wait a moment and try again.
            required:
              - error
              - error_hint
  schemas:
    RandomComplimentResponse:
      type: object
      properties:
        category:
          description: The category of the random compliment (defaults to general if a category was not supplied)
          type: string
          example: general
        compliment:
          description: The random compliment text
          type: string
          example: I admire your resilience in tough situations.
      required:
        - category
        - compliment

Example Request

curl --request GET \
	--url 'https://word-checker-api.p.rapidapi.com/v1/generator/random-compliment?category=$CATEGORY' \
	--header 'x-rapidapi-host: word-checker-api.p.rapidapi.com' \
	--header 'x-rapidapi-key: $YOUR_RAPID_API_KEY'

Request Parameters

Query Parameters

  • CATEGORY: The category of the random compliment. Refer to the Open API spec enum above for valid values. If you don’t provide a category on the request, a compliment from any category will be returned.

Headers

Example Response

A successful response will contain a JSON object with the category and compliment. The category will default to general if you did not request one.

{
  "category": "general",
  "compliment": "I admire your resilience in tough situations."
}

If a response is unsuccessful, a standard error response will be returned. For example, the below represents an INVALID_CATEGORY error.

{
  "error": "INVALID_CATEGORY",
  "error_hint": "The category provided was invalid."
}

The error_hint is meant for the application/server and may not always make sense to display to the end user.

ABOUT THE AUTHOR
Stephen Lunt is Word Checker's founder and primary content writer. He loves to share his experiences and knowledge of word games through writing and creating handy online tools for players to use.

Did you find this article helpful?