Learn the basic usage and setup of the Echoes API.
Echoes API is a powerful RESTful API that allows you to access inspiring quotes from different languages around the world. This guide will show you the basic usage of the API and how to integrate it into your project.
Echoes API offers the following features:
- List all quotes
- Get a specific quote by ID
- Get a random quote
- Filter by language or author
The base URL for all API requests:
https://echoes.soferity.com/api
Simple usage of the Echoes API doesn't require authentication. However, for high-volume usage, you may need to obtain an API key.
Here's a JavaScript example to get a simple quote:
fetch('https://echoes.soferity.com/api/quotes/random')
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
This request will return a random quote. The response will look something like this:
{
"id": 42,
"lang": "en",
"author": "Albert Einstein",
"quote": "Imagination is more important than knowledge."
}