https://github.com/naufan17/marvel-film-api
Rest API which provides Marvel movie and series data. There are around 30+ data in the form of titles, posters, trailers, release dates, durations, genres, directors, actors, plots and download links via torrent. Rest API is built using the Laravel framework with authentication using Sanctum
https://github.com/naufan17/marvel-film-api
film laravel marvel-api rest-api
Last synced: about 1 month ago
JSON representation
Rest API which provides Marvel movie and series data. There are around 30+ data in the form of titles, posters, trailers, release dates, durations, genres, directors, actors, plots and download links via torrent. Rest API is built using the Laravel framework with authentication using Sanctum
- Host: GitHub
- URL: https://github.com/naufan17/marvel-film-api
- Owner: naufan17
- Created: 2022-07-16T23:30:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-27T12:08:58.000Z (5 months ago)
- Last Synced: 2025-02-16T03:38:55.872Z (3 months ago)
- Topics: film, laravel, marvel-api, rest-api
- Language: PHP
- Homepage: https://marvel-film-api.fly.dev/
- Size: 537 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Marvel Film API
API that provides data for Marvel movies and series. There are around 30+ data in the form of titles, posters, release years, trailers, release dates, durations, genres, directors, authors, actors, plots and download links via torrent.## How to setup local code program:
- Clone this repository
- Run this command to import database structure:
```
php artisan migrate
```
- Run this command to start the server:
```
php artisan serve
```## API Documentation
### 1. Register User
- Method: `POST`
- URL Patterns: `/api/register`
- Authetication: `false`
- Body:
```json
{
"name": Varchar,
"email": Varchar,
"password": Varchar
}
```
- Usage:
```
curl -X POST \
-d '{
"name": "name",
"email": "email",
"password": "password"
}' \
URL_Patterns
```
- Response:
- Success: (200)
```json
{
"message": "Register successfull"
"token": String
"token_type": "Bearer"
}
```
- Errors: (404)
```json
{
"message": "Error"
}
```### 2. Login User
- Method: `POST`
- URL Patterns: `/api/login`
- Authetication: `false`
- Body:
```json
{
"email": Varchar,
"password": Varchar
}
```
- Usage:
```
curl -X POST \
-d '{
"email": "email",
"password": "password"
}' \
URL_Patterns
```
- Response:
- Success: (200)
```json
{
"message": "Login successfull"
"token": String
"token_type": "Bearer"
}
```
- Errors: (404)
```json
{
"message": "Error"
}
```### 3. Get Movies
- Method: `GET`
- URL Patterns: `/api/movies?title={title}&page={page}&limit={limit}`
- Authentication: `false`
- Params: `title or page or limit`
- Usage:
```
curl -X GET
URL_Patterns
```
- Response:
- Success: (200)
```json
{
"status": "Success",
"data": [
{
"current_page": 1,
"data": [
{
"id": BigInt,
"title": Varchar,
"poster": Varchar,
"year": Year,
"plot": Varchar
},
]
}
}
```
- Errors: (404)
```json
{
"message": "Data failed to get"
}
```### 4. Get Movies by Id
- Method: `GET`
- URL Patterns: `/api/movies/{id}`
- Authentication: `false`
- Usage:
```
curl -X GET
URL_Patterns
```
- Response:
- Success: (200)
```json
{
"status": "Success",
"data": {
"title": Varchar,
"poster": Varchar,
"year": Year,
"trailer": Varchar,
"released": Varchar,
"runtime": Varchar,
"genre": Varchar,
"director": Varchar,
"writer": Varchar,
"actors": Varchar,
"plot": Varchar,
"torrent": Text
},
}
```
- Errors: (404)
```json
{
"message": "Data failed to get"
}
```### 5. Add Movies
- Method: `POST`
- URL Patterns: `/api/movies`
- Authetication: `true`
- Body:
```json
{
"title": Varchar,
"year": Varchar,
"trailer": Varchar,
"torrent": text,
}
```
- Usage:
```
curl -X POST \
-H "Authorization: Bearer "
-d '{
"title": "title",
"year": "year",
"trailer": "trailer",
"torrent": "torrent"
}' \
URL_Patterns
```
- Response:
- Success: (200)
```json
{
"status": "Success",
"message": "Data stored successfully",
"data": {
"title": Varchar,
"poster": Varchar,
"year": Year,
"trailer": Varchar,
"released": Varchar,
"runtime": Varchar,
"genre": Varchar,
"director": Varchar,
"writer": Varchar,
"actors": Varchar,
"plot": Varchar,
"torrent": Text,
"update_at": Date,
"created_at": Date,
"id": BigInt,
},
}
```
- Errors: (404)
```json
{
"message": "Error"
}
```### 6. Delete Movies
- Method: `DELETE`
- URL Patterns: `/api/movies/{id}`
- Authetication: `true`
- Usage:
```
curl -X POST \
-H "Authorization: Bearer " \
URL_Patterns
```
- Response:
- Success: (200)
```json
{
"status": "Success",
"message": "Data deleted successfully",
}
```
- Errors: (404)
```json
{
"message": "Error"
}
```