Skip to content

alextutumy/PangolinTest

Repository files navigation

NYT Best Sellers API Wrapper

REST API service wrapper over the New York Times Best Sellers History API. Provides simplified access to NYT best sellers data with filtering capabilities.

Main Features

  • Search for books by author, ISBN, and title
  • Page-by-page navigation of results
  • Query caching for performance optimization

Implemented functions

  • API uses Laravel Form Requests for validation
  • Request caching implemented
  • Covered by tests, including edge cases
  • Supports tests without internet and API key

API Endpoints

GET /api/v1/best-sellers

Get the list of best-sellers with filtering.

Query parameters:

  • author (string, optional) - filter by author name
  • isbn[] (array of strings, optional) - filter by ISBN
  • title (string, optional) - filter by book title
  • offset (integer, optional) - offset for pagination, by default 0

Query example:

curl -X GET 'http://localhost:8000/api/v1/best-sellers?author=Stephen+King&offset=0'

Example Answer:

{
    "status": "success",
    "data": [
        {
            "title": "The Stand",
            "author": "Stephen King",
            "isbn": "978-0307743688",
            "publisher": "Anchor",
            "rank": 1
        }
    ],
    "meta": {
        "total": 1,
        "offset": 0
    }
}

4. How to run via Make

  • Clone repository
  • Run make install
  • Fillout NYT_API_KEY
  • Run make test

4. or Manually

  • Run composer install
  • copy .env.example and rename to .env
  • Run php artisan key:generate
  • Fill out NYT_API_KEY environment variables
  • Run php artisan test to run tests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages