Forismatic

Forismatic

Media

Place Inspirational Quotes on your websites / apps by making simple search queries. The API returns data in xml, json, jsonp, html and text. It includes only a Quote and the name of the author.

Visit API

📚 Documentation & Examples

Everything you need to integrate with Forismatic

🚀 Quick Start Examples

Forismatic Javascript Examplejavascript
// Forismatic API Example
const response = await fetch('http://forismatic.com/en/api/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introducing the Forismatic API Documentation

Have you ever wanted to add an inspirational quote to your website or application? Well, we have good news for you! Forismatic offers a free API that provides a vast collection of quotes to choose from. In this blog post, we will explore the Forismatic API documentation and provide you with some example code in JavaScript.

Getting Started with the Forismatic API

To access the Forismatic API, you need to first sign up for an API key on their website. Once you have the API key, you can start making requests to the API endpoint with your preferred programming language.

Using the Forismatic API in JavaScript

Now let's dive into some example code in JavaScript. First, we need to make an HTTP GET request to the Forismatic API endpoint with our API key. The code for this request looks like this:

const apiKey = YOUR_API_KEY;
const url = `http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en&key=${apiKey}`;

fetch(url)
  .then(response => response.json())
  .then(data => console.log(data));

In the code snippet above, we make use of the fetch() function to make a GET request to the API endpoint. We then chain a .then() method to parse the response data as JSON and return it as a JavaScript object. Finally, we log the data to the console.

The response data returned from the API endpoint looks like this:

{
  "quoteText": "The journey of a thousand miles begins with one step.",
  "quoteAuthor": "Lao Tzu",
  "senderName": "",
  "senderLink": "",
  "quoteLink": "http://forismatic.com/en/e5387b8645/"
}

As you can see, the data returned includes the quote text, author, and links to the original quote.

Conclusion

The Forismatic API is an excellent resource for developers looking to add inspiring quotes to their websites or applications. In this blog post, we showed you how to make requests to the API endpoint using JavaScript and provided you with an example of the response data. We hope you found this useful and recommend giving the Forismatic API a try!

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

May 31Jun 2Jun 4Jun 6Jun 8Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 2904008001440Minutes
Online
Offline

Related APIs in Media