Ipsum API documentation
Use the ever-faithful Curl, or the trendy upstart HTTPie, to generate ipsum copy straight from the command-line. If you want to use these Ipsums in your WordPress project, here’s a tutorial on how to consume a REST API in WordPress.
The URL for our REST API:
https://power-plugins.com/api/flipsum
JavaScript package:
npm i @headwall/flipsum-ipsum
ImportantIf we detect too many API calls coming from you in a short space of time, you’ll receive a HTTP 429 (too many requests) and a null body as the response.
Featured plugin
Some example API calls
#! /bin/sh # If you're using a Mac, just use curl to fetch and "python3 -m json.tool" # to format the response. curl -s "https://power-plugins.com/api/flipsum/ipsum" | python3 -m json.tool curl -s "https://power-plugins.com/api/flipsum/ipsum/lorem-ipsum" | python3 -m json.tool # Using Ubuntu/Debian, grab HTTPie and jq first, unless you want to use curl. sudo apt install httpie jq # then list all the ipsums... https power-plugins.com/api/flipsum/ipsum | jq . # and grab some gobbledygook (by referencing the ipsum's "slug")... https power-plugins.com/api/flipsum/ipsum/fairy-tale | jq . # More examples... # Use HTTPie to fetch a specific ipsum, and jq to format the response. https GET power-plugins.com/api/flipsum/ipsum/groovy paragraphs=9 | jq . # jq can also format a HTML response. https GET power-plugins.com/api/flipsum/ipsum/jabberwocky html=1 | jq --raw-output . # Use curl to fetch a specific ipsum, and jq to format it. curl -s https://power-plugins.com/api/flipsum/ipsum/song-lyrics | jq . # Fetch 10 paragraphs without the fixed/suggested opening sentence. curl -s "https://power-plugins.com/api/flipsum/ipsum/song-lyrics?paragraphs=10&start_with_fixed=0" | jq . # These two calls are equivalent. https GET power-plugins.com/api/flipsum/ipsum/coffee-shop paragraphs=10 start_with_fixed=0 | jq . https "power-plugins.com/api/flipsum/ipsum/coffee-shop?paragraphs=10&start_with_fixed=0" | jq .
Endpoints & parameters
Endpoint: /ipsum
List all the ipsums as short arrays collections of meta data in an array.
# Use HTTPie to grab all ipsum generators https power-plugins.com/api/flipsum/ipsum
You can use an ipsum’s “slug” field to uniquely reference the ipsum.
[ { "home-url": "https://power-plugins.com/developer-tools/ipsum-text-generator/?ipsum=lorem-ipsum", "long-name": "Classic Ipsum", "name": "Classic Lorem Ipsum", "slug": "lorem-ipsum", "suggested-button-text": "Make Some Ipsum", "suggested-first-sentence": "Lorem ipsum dolor sit amet" }, { "home-url": "https://power-plugins.com/developer-tools/ipsum-text-generator/?ipsum=corporate", "long-name": "Corporate BS", "name": "Corporate", "slug": "corporate", "suggested-button-text": "Leverage Vertical Ipsums", "suggested-first-sentence": "Lorem ipsum dolor leverage vertical sit amet" }, // ... SNIP ... ]
Endpoint: /ipsum/:slug
Generate some random ipsum, with a default query args. Returns an array of 3 paragraphs. If the Ipsum’s slug is not found, it returns a 404 HTTP Response.
Parameter | Usage |
---|---|
paragraphs positive integer | How may paragraphs of gobbledygook do you want. |
start_with_fixed 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. |
html bool (1 or 0) | Return the gobbledygook as a pre-formatted HTML string instead of an array of JSON strings. |