Endpoints Doc
This section provides detailed information on each API endpoint available in the Miragek Quote API.
Random Quote Endpoint​
- Example:
https://quotes.miragek.com/api?author=J&rand=3&api_key=test
- Method:
GET
- Query Parameters:
category
(optional): Filter quotes by category.author
(optional): Filter quotes by a specific author.
Example Request​
GET api?author=J&rand=3&api_key=test
Host: quotes.miragek.com
Example Response​
{
"quote": "Life is like riding a bicycle. To keep your balance, you must keep moving.",
"author": "Albert Einstein",
"category": "inspiration"
}
Error Handling​
- 400 Bad Request: Returned when the request is invalid or parameters are incorrect.
- 404 Not Found: Returned when no quote matches the criteria.
Quotes by Category Endpoint​
- URL:
category
- Method:
GET
- Query Parameters:
category
(required): Specify the category of quotes to retrieve.limit
(optional): Specify the maximum number of quotes to return.
Example Request​
GET api?rand=1?category=inspiration HTTP/1.1
Host: quotes.miragek.com
Example Response​
{
"quotes": [
{
"quote": "The only way to do great work is to love what you do.",
"author": "Steve Jobs",
"category": "inspiration"
},
{
"quote": "Your time is limited, don't waste it living someone else's life.",
"author": "Steve Jobs",
"category": "inspiration"
}
]
}
Error Handling​
- 400 Bad Request: Returned when the request is invalid or the category is missing.
- 404 Not Found: Returned when no quotes are found in the specified category.
Quotes by Author Endpoint​
- URL:
author
- Method:
GET
- Query Parameters:
author
(required): Specify the author of the quotes to retrieve.limit
(optional): Specify the maximum number of quotes to return.
Example Request​
GET api?author=mark twain&rand=3 HTTP/1.1
Host: quotes.miragek.com
Example Response​
{
"quotes": [
{
"quote": "The secret of getting ahead is getting started.",
"author": "Mark Twain",
"category": "motivation"
},
{
"quote": "The best way to cheer yourself is to try to cheer someone else up.",
"author": "Mark Twain",
"category": "humor"
}
]
}
Error Handling​
- 400 Bad Request: Returned when the request is invalid or the author is missing.
- 404 Not Found: Returned when no quotes are found by the specified author.