Breaking Bad Quotes

Breaking Bad Quotes

Video

Some Breaking Bad quotes. A simple API to retrieve some quotes of Breaking Bad, bitch! If you want to add some quotes, just add them in quotes.js file and do a pull request !

Visit API

📚 Documentation & Examples

Everything you need to integrate with Breaking Bad Quotes

🚀 Quick Start Examples

Breaking Bad Quotes Javascript Examplejavascript
// Breaking Bad Quotes API Example
const response = await fetch('https://github.com/shevabam/breaking-bad-quotes', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

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

Using The Breaking Bad Quotes Public API

If you're a fan of the show Breaking Bad, you'll be excited to learn that there is a public API available that you can use to retrieve and display quotes from the show. In this blog, we'll learn how to use the Breaking Bad Quotes API with JavaScript.

Getting Started

To get started, we need to understand the structure of the API. The Breaking Bad Quotes API is a RESTful API that returns quotes from the show as JSON objects. The API is located at https://breaking-bad-quotes.herokuapp.com/v1/quotes.

API Example Code

Here is some code that you can use to retrieve quotes from the API using JavaScript:

fetch('https://breaking-bad-quotes.herokuapp.com/v1/quotes')
  .then(response => response.json())
  .then(data => {
     // Do something with the data 
     console.log(data[0].quote);
  });

This code uses the fetch function to send a GET request to the API endpoint. Once the response is received, it is parsed as JSON and the data is available for use in the callback function. In this example, we simply access the quote property of the first element in the returned array and log it to the console.

Here's another example that demonstrates how to use the API with the XMLHttpRequest object:

let xhr = new XMLHttpRequest();
xhr.open('GET', 'https://breaking-bad-quotes.herokuapp.com/v1/quotes');
xhr.responseType = 'json';
xhr.onload = function() {
   // Do something with the data
   console.log(xhr.response[0].quote);
};
xhr.send();

Here, we create an XMLHttpRequest object and send a GET request to the API endpoint. Once the response is received, it is parsed as JSON and the data is available for use in the onload callback function. Again, we simply access the quote property of the first element in the returned array and log it to the console.

Conclusion

In this blog, we've learned how to use the Breaking Bad Quotes API with JavaScript. By sending a GET request to the API endpoint, we can retrieve and display quotes from the show. So, if you're a fan of Breaking Bad, be sure to check out this API and start using it in your projects!

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 28Jun 30Jul 2Jul 4Jul 6Jul 904008001440Minutes
Online
Offline

Related APIs in Video