电影 API
知名电影,带导演、类型、演员、评分和票房。内存中的固定数据:写入会保留到应用重启为止。
你的账号已解锁这些端点。在每个端点的页面上用 Try it 发送请求。
- GET
https://api.testingapis.com/api/MoviesList movies with filtering, sorting, search and paginationList movies with filtering, sorting, search and pagination. - POST
https://api.testingapis.com/api/MoviesCreate a movieCreate a movie. - GETHEAD
https://api.testingapis.com/api/Movies/{id}Get a movie by IDGet a movie by ID (HEAD returns the headers only). - PUT
https://api.testingapis.com/api/Movies/{id}Replace a movieReplace a movie. - PATCH
https://api.testingapis.com/api/Movies/{id}Partially update a movie with a JSON merge patchPartially update a movie with a JSON merge patch. - DELETE
https://api.testingapis.com/api/Movies/{id}Delete a movieDelete a movie. - POST
https://api.testingapis.com/api/Movies/bulkCreate up to 100 movies in one requestCreate up to 100 movies in one request. - DELETE
https://api.testingapis.com/api/Movies/bulkDelete several movies by IDDelete several movies by ID. - GET
https://api.testingapis.com/api/Movies/countCount all moviesCount all movies. - GET
https://api.testingapis.com/api/Movies/genresList every genre used by any movie, sorted and without duplicatesList every genre used by any movie, sorted and without duplicates. - GET
https://api.testingapis.com/api/Movies/topList the highest-rated moviesList the highest-rated movies. - GET
https://api.testingapis.com/api/Movies/year/{year}List movies released in a given yearList movies released in a given year.
请求示例
List movies with filtering, sorting, search and pagination. 完整参考和 Send 按钮(英文).
cURL
curl -X GET "https://api.testingapis.com/api/Movies?limit=2"响应 · 200 OK
[
{
"id": 1,
"title": "The Shawshank Redemption",
"director": "Frank Darabont",
"year": 1994,
"genres": ["Drama"],
"runtimeMinutes": 142,
"rating": 9.3,
"cast": ["Tim Robbins", "Morgan Freeman"],
"boxOffice": 58300000,
"poster": "https://picsum.photos/seed/movie1/300/450"
… (3 more lines)筛选、排序与分页
列表端点接受 limit、page、offset、sort、order 和 q,任何字段名都可用作精确筛选。总数通过 X-Total-Count 响应头返回。写入的数据在服务器重启前都保存在内存中,所以测试可以随意创建、修改和删除记录。 查询参数参考.