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.


  • 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’


Some sample jquery code!

			{ 'type':'meat-and-filler', 'start-with-lorem':'1', 'paras':'3' }, 
			if (baconGoodness && baconGoodness.length > 0)
				for (var i = 0; i < baconGoodness.length; i++)
					$("#baconIpsumOutput").append('<p>' + baconGoodness[i] + '</p>');

Run the sample!

31 Responses to JSON API

  1. Vanessa says:

    Dudes. This is awesome. That is all!

  2. violacase says:

    Can’t stop laughing…
    Very nice!

  3. violacase says:

    To be honest: It’s TOO funny. I wasn’t able to produce a single line of serious code the last 2 hours.

  4. sameer says:

    beautiful and tasty!

  5. Jim Smart says:


    Can you please make it so this can work with CORS? Currently the baconipsum API can’t be used by many Javascript frameworks, the browser denies access (because you don’t explicitly specify otherwise).

    To fix this, you need to make your server push out the following header with your JSON response:

    Access-Control-Allow-Origin: *

    More details here: http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server

    Thanks in advance!

  6. Jim Smart says:

    Hey — thanks for the awesome super quick fix-up! 🙂

  7. Surekha says:


  8. Daniel Furze says:

    Wicked cool, thanks! 😀

  9. Pall Thayer says:

    This is awesome. However, the api returns text with two spaces after a period. This is wrong. There should only be a single space after a period. http://www.slate.com/articles/technology/technology/2011/01/space_invaders.html

  10. Pete Nelson @GunGeekATX says:

    You can always branch and do a pull request if you’d like anything changed: https://github.com/petenelson/bacon-ipsum

  11. Marnix says:


  12. Jay says:

    I’m getting CORS issues.
    XMLHttpRequest cannot load http://baconipsum.com/api/?type=meat-and-filler&start-with-lorem=1&paras=2. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://run.plnkr.co’ is therefore not allowed access.

    I tried to create a basic example in a plunker, but I get that error message. It worked once, then on the 2nd occurrence it failed. Any ideas?

  13. Pete Nelson @GunGeekATX says:

    I double-checked the output and it is returning “Access-Control-Allow-Origin: *” in the header, not sure why you’d be getting that CORS error.

    • Alexander Hitrov says:

      that’s because there should be more headers e.g.
      Access-Control-Allow-Methods: GET
      Access-Control-Allow-Headers: Content-Type

  14. Moazam says:

    Very useful API

  15. Clay says:

    Love it, but the ‘sentences’ param doesn’t work – I set sentences=1 (even used the example link) and it returns a full paragraph, multiple sentences.

  16. Pingback: 5 Fun Lorem Ipsum Generators | Coffee, Code & Cats

  17. V says:

    do you have something vegetarian-friendly?

  18. Pingback: Promises vs. Callbacks - troublemaker.xyz

  19. Vegetarian says:

    Bacon is life

  20. Edgars says:

    I use this for all of my development demos

  21. Adam Holmes says:

    My colleagues will hate me now, thanks 😀

    function ipsum(paras, el) {
    var pAmount = paras || 2;
    var ipsumUrl = ‘https://baconipsum.com/api/?type=meat-and-filler&paras=’ + pAmount + ‘&format=text’;
    var request = new XMLHttpRequest();
    request.open(‘GET’, ipsumUrl, true);
    request.onload = function() {
    el.innerText = request.responseText;

  22. bmwsauber says:

    Awesome! Thanks!

  23. bng44270 says:

    Python (returns array of paragraphs):

    bacon = lambda x : requests.get(‘https://baconipsum.com/api/?type=all-meat&paras=’ + str(x) + ‘&format=json’).json()

  24. Daniel Pérez says:

    Thanks for this, used it in my golang project and had a laugh!

Leave a Reply

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