Ipsum REST API

Use the ever-faithful Curl, or the trendy upstart HTTPie, to generate ipsum copy straight from the command-line using the free ipsum REST API.

Example API Calls

#! /bin/sh

# If you're using a Mac, just use curl to fetch and "python -m json.tool"
# to format the response. If you get an error about "python" being missing,
# try using "python2" or "python3" instead.
curl -s "https://flipsum-ipsum.net/api/icw/v1/ipsums" | python -m json.tool
curl -s "https://flipsum-ipsum.net/api/icw/v1/generate" | python -m json.tool

# Using Ubuntu/Debian, grab HTTPie and jq first, unless you want to use curl.
sudo apt install httpie jq
# ...then grab some ipsum...
http GET "https://flipsum-ipsum.net/api/icw/v1/ipsums" | jq .
http GET "https://flipsum-ipsum.net/api/icw/v1/generate" ipsum=fairy-tale | jq .

# More examples...

# Use HTTPie to fetch a specific ipsum, and jq to format the response.
http GET "https://flipsum-ipsum.net/api/icw/v1/generate" ipsum=groovy paragraphs=9 | jq .

# jq can also format a HTML response.
http GET "https://flipsum-ipsum.net/api/icw/v1/generate" ipsum=corporate format_html=1 | jq .

# Use curl to fetch a specific ipsum, and jq to format it.
curl -s "https://flipsum-ipsum.net/api/icw/v1/generate?ipsum=lyrics" | jq . 

# Fetch 10 paragraphs without the fixed/suggested opening sentence.
curl -s "https://flipsum-ipsum.net/api/icw/v1/generate?paragraphs=10&start_with_fixed=0" | jq .

# These two calls are equivalent.
http GET "https://flipsum-ipsum.net/api/icw/v1/generate" ipsum=cafe paragraphs=10 start_with_fixed=0 | jq .
http GET "https://flipsum-ipsum.net/api/icw/v1/generate?ipsum=cafe&paragraphs=10&start_with_fixed=0" | jq .

Ipsum REST API URL

https://flipsum-ipsum.net/api/icw/v1

/ipsums

List all the available ipsum generators, with short names and descriptions. The /ipsums endpoint doesn’t accept any parameters.

/generate

ParameterUsage
ipsumType: string
The short name of the ipsum generator you want to use. If not specified, then a random ipsum generator is used.
paragraphsType: int
How many paragraphs of gobbledygook do you want? This value is sanity checked against the server’s configuration, so if you pass it some text, or specify a silly-big (or negative) number, you’ll either get an error, or a capped number or paragraphs.
start_with_fixedType: bool (1 or 0)
If the ipsum dictionary comes with an optional suggested opening sentence, then you can choose to use it here by specifying a value of 1 (one). If you don’t specify one or zero then the server may or may not include the suggested opening sentence, depending on how the ipsum generator has been configured.
format_htmlType: bool (1 or 0)
Return the gobbledygook as a pre-formatted HTML string instead of an array of JSON strings.
HTTP GET parameters for the /generate endpoint.

Fair Use & Throttling

We monitor and occasionally throttle API requests. So if you batter API with 100 requests per second, don’t be surprised if you start seeing funny error messages.

We might even block your IP address completely, or send you to the naughty step to think about what you’ve done.

Leave a Reply

Your email address will not be published. Required fields are marked *