A RESTful JSON API for the Breaking Bad TV series providing detailed data about characters, episodes, quotes, deaths, and filming locations.
- Characters: Complete character information including name, birthday, occupation, status, and more
- Episodes: Episode details with season, episode number, air date, and character appearances
- Quotes: Memorable quotes from the series with author attribution
- Deaths: Death records including cause, responsible party, and last words
- Locations: Filming locations with coordinates and addresses
- Random Endpoints: Get random quotes and episodes
- Pagination: All list endpoints support pagination
- Filtering: Filter results by various attributes
- Swagger Documentation: Interactive API documentation
- Ruby: 3.2.3
- Rails: 7.1.6 (API mode)
- Database: SQLite3
- Testing: RSpec with Factory Bot
- Documentation: Swagger/OpenAPI 3.0
- Pagination: Kaminari
- CORS: Rack CORS
- Clone the repository:
git clone https://github.com/imlakshay08/breaking-bad-api.git
cd breaking-bad-api- Install dependencies:
bundle install- Set up the database:
bundle exec rake db:create db:migrate db:seed- Start the server:
bundle exec rails serverThe API will be available at http://localhost:3000
GET /api/v1/characters- List all characters- Query params:
page,per_page,name,status,category
- Query params:
GET /api/v1/characters/:id- Get a specific character
GET /api/v1/episodes- List all episodes- Query params:
page,per_page,season,series
- Query params:
GET /api/v1/episodes/:id- Get a specific episodeGET /api/v1/episodes/random- Get a random episode
GET /api/v1/quotes- List all quotes- Query params:
page,per_page,author,series
- Query params:
GET /api/v1/quotes/:id- Get a specific quoteGET /api/v1/quotes/random- Get a random quote
GET /api/v1/deaths- List all deaths- Query params:
page,per_page,season,responsible
- Query params:
GET /api/v1/deaths/:id- Get a specific death
GET /api/v1/locations- List all locations- Query params:
page,per_page,city,state
- Query params:
GET /api/v1/locations/:id- Get a specific location
curl http://localhost:3000/api/v1/characterscurl http://localhost:3000/api/v1/quotes/randomcurl "http://localhost:3000/api/v1/characters?status=Alive"curl "http://localhost:3000/api/v1/episodes?season=2"All list endpoints support pagination using the following query parameters:
page: Page number (default: 1)per_page: Items per page (default: 10, max: 100)
Example:
curl "http://localhost:3000/api/v1/characters?page=1&per_page=5"Interactive Swagger documentation is available at:
http://localhost:3000/api-docs
Run the test suite:
# All tests
bundle exec rspec
# Model tests only
bundle exec rspec spec/models
# Request tests only
bundle exec rspec spec/requests
# Integration tests
bundle exec rspec spec/integration- name, birthday, occupation, img, status, nickname, appearance, portrayed, category
- title, season, episode, air_date, characters, series
- quote, author, series
- death, cause, responsible, last_words, season, episode, number_of_deaths
- name, lat, lng, address, city, state, zip
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- Data sourced from the Breaking Bad TV series
- Built with Ruby on Rails
- Inspired by the need for comprehensive Breaking Bad data