-
GET /books - List books with filtering and pagination
- Query Parameters:
skip(int, default: 0) - Number of records to skiplimit(int, default: 100, max: 1000) - Maximum records to returnauthor(string, optional) - Filter by author (partial match)title(string, optional) - Filter by title (partial match)status(string, optional) - Filter by status (available, borrowed)
- Response:
PaginatedBookResponsewith items, total, skip, limit
- Query Parameters:
-
POST /books - Add a book by ISBN
- Body:
{"isbn": "string"} - Response:
BookResponse
- Body:
-
GET /books/{isbn} - Get book by ISBN
- Response:
BookResponse
- Response:
-
DELETE /books/{isbn} - Delete a book
- Response:
{"message": "Kitap silindi"}
- Response:
-
GET /books/{isbn}/borrows - Get borrow history for a book
- Query Parameters:
active_only(bool, default: false) - Show only active borrows
- Response:
List[BorrowRecordResponse]
- Query Parameters:
-
POST /members - Create a new member
- Body:
{"name": "string"} - Response:
MemberResponse
- Body:
-
GET /members - List all members
- Query Parameters:
skip(int, default: 0)limit(int, default: 100, max: 1000)
- Response:
List[MemberResponse]
- Query Parameters:
-
GET /members/{member_id} - Get member details
- Response:
MemberResponse
- Response:
-
GET /members/{member_id}/borrows - Get member's borrow history
- Query Parameters:
active_only(bool, default: false) - Show only active borrows
- Response:
List[BorrowRecordResponse]
- Query Parameters:
-
POST /borrow - Borrow a book
- Body:
{"member_id": int, "isbn": "string"} - Response:
{"message": "Kitap başarıyla ödünç alındı"}
- Body:
-
POST /return - Return a book
- Body:
{"member_id": int, "isbn": "string"} - Response:
{"message": "Kitap başarıyla iade edildi"}
- Body:
-
GET /health - Health check
- Response:
{"status": "healthy", "books_count": int}
- Response:
-
GET / - Welcome message
- Response:
{"message": "Library Management API'ye hoş geldiniz!"}
- Response:
{
"title": "string",
"author": "string",
"isbn": "string",
"status": "available" | "borrowed"
}{
"items": [BookResponse],
"total": int,
"skip": int,
"limit": int
}{
"id": int,
"name": "string"
}{
"id": int,
"member_id": int,
"isbn": "string",
"borrow_date": "ISO8601 string",
"return_date": "ISO8601 string" | null
}curl "http://localhost:8000/books?author=Orwell&status=available&skip=0&limit=10"curl "http://localhost:8000/members/1/borrows?active_only=true"curl -X POST "http://localhost:8000/borrow" \
-H "Content-Type: application/json" \
-d '{"member_id": 1, "isbn": "9780451524935"}'FastAPI automatically generates interactive API documentation:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc