JSON API

The Bacon Ipsum JSON API is a REST interface for generating meaty lorem ipsum text and can be used by any application. Pass in the following parameters using an HTTPS GET and we’ll return a JSON string array of paragraphs.

Parameters:

  • type: all-meat for meat only or meat-and-filler for meat mixed with miscellaneous ‘lorem ipsum’ filler.
  • paras: optional number of paragraphs, defaults to 5.
  • sentences: number of sentences (this overrides paragraphs)
  • start-with-lorem: optional pass 1 to start the first paragraph with ‘Bacon ipsum dolor sit amet’.
  • format: ‘json’ (default), ‘text’, or ‘html’

Examples:

Some sample jquery code!

$(document).ready(function() {	$("#baconButton").click(function()	{	$.getJSON('https://baconipsum.com/api/?callback=?',	{ 'type':'meat-and-filler', 'start-with-lorem':'1', 'paras':'3' },	function(baconGoodness)	{	if (baconGoodness && baconGoodness.length > 0)	{	$("#baconIpsumOutput").html('');	for (var i = 0; i < baconGoodness.length; i++)	$("#baconIpsumOutput").append('<p>' + baconGoodness[i] + '</p>');	$("#baconIpsumOutput").show();	}	});	}); });

Run the sample!