Skip to content
๐Ÿ”“ No Auth Required๐Ÿ” GET & POST๐Ÿงพ JSON Responses๐Ÿ“ Plain & HTML Formats

Fetch Ethical placeholder text via the Vegan Ipsum API

Build dynamic, cruelty-free mockups with our lightweight REST API. Integrate plant-based placeholder text directly into your frontend or backend applications via simple JSON endpoints. This API provides paragraphs, sentences, or words in plain or HTML format.

Introduction

Vegan Ipsum JSON API

The Vegan Ipsum JSON API is a high-performance web service designed to help developers seamlessly integrate vegan-themed placeholder text into their applications, websites, and digital projects.

Whether you need multiple paragraphs for blog mockups, a few sentences for UI prototypes, or single words to fill form inputs, this API offers flexible parameters to customize the generated content to your exact requirements.

The API returns content in both plain text and HTML formats, making it ready for immediate insertion into web pages or templates. It supports standard GET requests for simple retrieval and POST requests for more complex payloads via JSON.

Root Endpoint

API Base URL

All API endpoints are relative to the following base URL. We strongly recommend using HTTPS for all requests to ensure security and data integrity.

Base URL
https://veganipsum.vercel.app/api

HTTP Protocol

Request Methods

The Vegan Ipsum API supports standard HTTP request methods to fetch vegan-themed placeholder text. Both GET and POST requests return the same JSON response structure and accept identical parameters.

GET

Query Parameters

Send parameters as query strings appended to the URL. This method is ideal for quick requests and can be easily tested via a browser address bar or command-line tools like cURL.

POST

JSON Body

Send parameters as a JSON object in the request body. Use this method for complex queries or when integrating securely within client-server applications.

Customization

Query Parameters

Customize the API output using the following request parameters. These options provide full control over the volume, unit type, and format of the generated placeholder text to perfectly fit your UI layout.

NameTypeRequiredDefaultDescription
countnumberNo3The number of units to generate. Accepts an integer between 1 and 100.
unitsstringNoparagraphsThe type of text unit. Accepted values are paragraphs, sentences, or words.
formatstringNoplainThe output format. Use plain for raw text strings or html to wrap paragraphs in <p> tags.
Note

Use the format=html parameter when injecting content directly into web pages. This preserves the intended paragraph structure without requiring additional processing on the client side.

Query Strings

GET Request Example

When using GET requests, parameters are appended to the URL as query strings. The following examples demonstrate how to fetch specific amounts and formats of plant-based placeholder text using standard tools and libraries.

Browser / URL
# Retrieve 2 paragraphs of plain text
https://veganipsum.vercel.app/api?count=2&units=paragraphs&format=plain
cURL
curl "https://veganipsum.vercel.app/api?count=3&units=sentences&format=html"
JavaScript (fetch)
const res = await fetch('https://veganipsum.vercel.app/api?count=3&units=sentences&format=plain');
const data = await res.json();
console.log(data.text);

JSON Body

POST Request Example

For POST requests, send parameters as a JSON object in the request body. This method is ideal for programmatic API calls from backend services or frontend applications where query strings might become cluttered or exceed URL length limits.

cURL
curl -X POST "https://veganipsum.vercel.app/api" \
  -H "Content-Type: application/json" \
  -d '{"count": 5, "units": "sentences", "format": "plain"}'
JavaScript (fetch)
const res = await fetch('https://veganipsum.vercel.app/api', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ count: 5, units: 'sentences', format: 'plain' })
});
const data = await res.json();
console.log(data.text);

JSON Output

Response Format

A successful API request returns a JSON object containing a single text property. This string holds your generated vegan ipsum content, formatted exactly as requested and ready for immediate integration.

JSON Response ยท 200 OK
{
  "text": "Cucumber asparagus lentils smoothie harmony kind eggplant pancake laborum non brussels beetroot pepper plant sustain. Nostrud lettuce cillum cucumber celery positivity reprehenderit turmeric laboris chard voluptate eu comfort. Minim vegan-burger nutrients shallot ad humility okra."
}

The response strictly adheres to the parameters defined in your request, including thecount, units, and format, ensuring the output fits seamlessly into your application's layout.

Bad Request

Error Handling

If a request contains invalid parameters or values outside the allowed ranges, the API returns a 400 Bad Request status code. The response body includes a descriptive error message to help you debug the issue efficiently.

JSON Error Response ยท 400 Bad Request
{
  "error": "Invalid count. Please provide a number between 1 and 100."
}
Note

Implement client-side validation for your input parameters before sending requests to ensure smooth API usage and prevent unnecessary errors.

Status Codes

HTTP Status Codes

The API utilizes standard HTTP status codes to indicate the result of a request. Below are the most common codes you may encounter when interacting with the endpoint:

  • 200

    OK

    Request was successful. The response contains the requested vegan ipsum text.

  • 400

    Bad Request

    Your request had invalid or missing parameters. Review the error message and try again.

  • 404

    Not Found

    The endpoint you tried to access does not exist. Check the URL and request method.

  • 500

    Internal Server Error

    Something went wrong on the server side. Try again later or contact support if the problem persists.