The PonyBreed API provides an interface for the PonyBreeds ruby gem. At the moment, the API is hosted on Render using a free tier, so the first request might be a bit slow.
With Redis caching in place, the system intelligently stores frequently accessed data. This not only accelerates data retrieval but also reduces the need for repetitive queries.
In order to access the API you don't need a key, and it free to use. You can use this API to learn new things, practice or build a small project. Users can make HTTP requests to the Pony API endpoints to fetch desired data. Responses are in JSON format, ensuring compatibility with a broad range of applications and platforms.
In order to use this API locally, you will need to have Ruby and Rails installed on your system.
Once you have these prerequisites installed, follow these steps:
- Clone this repository to your local machine
- Navigate to the project directory and run
bundle install
- Start the API server by running
rails server
In order to test the Redis caching locally, you will need to have Redis installed. If Redis is not installed, the values will be retrieved from the pony_breeds gem.
Retrieve the pony data by the JSON key
GET https://pony-breed-api.onrender.com/api/v1/pony_by_key?key=american_walking_pony
{
name: 'American Shetland Pony',
description: 'Short description about the pony',
wiki_url: 'https://en.wikipedia.org/wiki/American_Shetland_Pony'
}
Retrieve the pony data by the actual name of the pony
GET https://pony-breed-api.onrender.com/api/v1/pony_by_name?name=American Walking Pony
{
name: 'American Walking Pony',
description: 'Short description about the pony',
wiki_url: 'https://en.wikipedia.org/wiki/American_Walking_Pony"'
}
Retrieve data for a random pony
GET https://pony-breed-api.onrender.com/api/v1/random_pony
{
name: 'Timor pony',
description: 'Short description about the pony',
wiki_url: 'https://en.wikipedia.org/wiki/Timor_Pony'
}
Note: All responses are in the JSON format
Contributions are welcomed to this project! If you have an idea for a new feature or find a bug, please open an issue in this repository.
To contribute code to the project, follow these steps:
1. Fork this repo
2. Create a new branch for your changes
3. Make the necessary changes and commit them to your branch
4. Push your branch to your forked repository
5. Open a pull request from your branch to this repository
I will review your changes and merge them into the project if they are approved.
The gem is available as open source under the terms of the MIT License.