API

Random Sentence Generator API

This reference page documents the JSON format used by the sentence generator project. The Cloudflare static package focuses on the browser-based generator, so a live API endpoint is not included in this export build.

Base URL

https://randomsentencegenerator.tools/api/generate

GET /api/generate

GET /api/generate?category=funny&type=simple&count=5&length=medium&tense=any
ParamTypeDefaultOptions
categorystringrandomrandom, funny, inspirational, academic, mystery, scifi, romance, horror
typestringsimplesimple, compound, complex
countinteger11-20
lengthstringmediumshort, medium, long
tensestringanyany, past, present, future
stylestringcasualformal, casual, poetic
vocabularystringmixedbasic, advanced, mixed
nounstringnoneoptional custom noun
verbstringnoneoptional custom verb
adjectivestringnoneoptional custom adjective

Response

{
  "success": true,
  "count": 2,
  "sentences": [
    {
      "id": "abc123",
      "text": "The curious fox leaped over a golden fence.",
      "category": "random",
      "type": "simple",
      "length": "medium",
      "tense": "any",
      "style": "casual"
    }
  ]
}

Try it in the product

The interactive generator uses the same option model shown here, so you can still test categories, sentence types, tense, vocabulary and style directly in the static site.