IMDb API - 标题主要演员和工作人员 (V1)
获取标题的主要演员和剧组人员信息。
典型使用场景:
- 列出电影或电视剧的导演、编剧和主要演员。
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
token | query | string | 是 | 用户的鉴权令牌。 |
id | query | string | 是 | 该标题的唯一IMDb ID(例如:tt12037194)。 |
languageCountry | query | string | 否 | 语言与国家/地区偏好。 可用值: - en_US: 英语(美国)- fr_CA: 法语(加拿大)- fr_FR: 法语(法国)- de_DE: 德语(德国)- hi_IN: 印地语(印度)- it_IT: 意大利语(意大利)- pt_BR: 葡萄牙语(巴西)- es_ES: 西班牙语(西班牙)- es_US: 西班牙语(美国)- es_MX: 西班牙语(墨西哥) |
代码示例
💡 环境说明
默认示例使用 https://api.justoneapi.com (prod-global)。中国大陆地区建议替换为 http://47.117.133.51:30015 (prod-cn) 以获得更好的访问体验。详见 环境选择。
bash
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
curl -X GET "https://api.justoneapi.com/api/imdb/title-top-cast-and-crew/v1?token=YOUR_API_KEY&id=VALUE"text
我想使用 Just One API 提供的“标题主要演员和工作人员 (V1)”接口。
接口地址: https://api.justoneapi.com/api/imdb/title-top-cast-and-crew/v1
HTTP 方法: GET
身份验证: 在 URL 后添加查询参数“?token=您的API密钥”。
OpenAPI 定义: https://docs.justoneapi.com/openapi/imdb-apis/title-top-cast-and-crew-v1-zh.json
请求参数说明:
- token (query): 用户的鉴权令牌。 (必填)
- id (query): 该标题的唯一IMDb ID(例如:tt12037194)。 (必填)
- languageCountry (query): 语言与国家/地区偏好。
可用值:
- `en_US`: 英语(美国)
- `fr_CA`: 法语(加拿大)
- `fr_FR`: 法语(法国)
- `de_DE`: 德语(德国)
- `hi_IN`: 印地语(印度)
- `it_IT`: 意大利语(意大利)
- `pt_BR`: 葡萄牙语(巴西)
- `es_ES`: 西班牙语(西班牙)
- `es_US`: 西班牙语(美国)
- `es_MX`: 西班牙语(墨西哥)
返回格式: JSON
响应处理与错误码:
1. 需通过返回体中的 "code" 字段判断业务结果(code 为 0 表示成功)。
2. 超时建议:建议将请求超时时间设置为至少 60 秒。
3. 业务码说明:
- 0: 成功
- 100: Token 无效或已失效
- 301: 采集失败,请重试
- 302: 超出速率限制
- 303: 超出每日配额
- 400: 参数错误
- 500: 内部服务器错误
- 600: 权限不足
- 601: 余额不足
请帮我用我擅长的编程语言写一个脚本来调用这个接口,并处理返回结果。python
# 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import requests
url = "https://api.justoneapi.com/api/imdb/title-top-cast-and-crew/v1?token=YOUR_API_KEY&id=VALUE"
response = requests.get(url)
print(response.json())js
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
const response = await fetch("https://api.justoneapi.com/api/imdb/title-top-cast-and-crew/v1?token=YOUR_API_KEY&id=VALUE", {
method: "GET"
});
const data = await response.json();
console.log(data);java
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.justoneapi.com/api/imdb/title-top-cast-and-crew/v1?token=YOUR_API_KEY&id=VALUE"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}go
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
url := "https://api.justoneapi.com/api/imdb/title-top-cast-and-crew/v1?token=YOUR_API_KEY&id=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}php
// 提示: 中国大陆地区建议将 https://api.justoneapi.com 替换为 http://47.117.133.51:30015
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.justoneapi.com/api/imdb/title-top-cast-and-crew/v1?token=YOUR_API_KEY&id=VALUE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
curl_close($ch);
echo $response;响应结果
json
{
"code": 0,
"data": {
"title": {
"id": "tt12037194",
"titleType": {
"__typename": "TitleType",
"id": "movie",
"text": "Movie",
"categories": [
{
"id": "movie",
"text": "Movie",
"value": "movie"
}
],
"canHaveEpisodes": false,
"isEpisode": false,
"isSeries": false,
"displayableProperty": {
"value": {
"plainText": ""
}
}
},
"principalCredits": [
{
"credits": [
{
"__typename": "Crew"
}
]
},
{
"credits": [
{
"__typename": "Crew"
},
{
"__typename": "Crew"
}
]
},
{
"credits": [
{
"__typename": "Cast",
"characters": [
{
"id": "Furiosa",
"name": "Furiosa"
}
],
"name": {
"__typename": "Name",
"id": "nm5896355",
"nameText": {
"text": "Anya Taylor-Joy"
},
"primaryImage": {
"__typename": "Image",
"id": "rm4152883713",
"url": "https://m.media-amazon.com/images/M/MV5BMGZjYzcxNDEtNTU1Yi00Nzc3LTlhZjQtZTUwZDQxNjQ5MDIzXkEyXkFqcGc@._V1_.jpg",
"height": 2048,
"width": 1365
}
}
},
{
"__typename": "Cast",
"characters": [
{
"id": "Dementus",
"name": "Dementus"
}
],
"name": {
"__typename": "Name",
"id": "nm1165110",
"nameText": {
"text": "Chris Hemsworth"
},
"primaryImage": {
"__typename": "Image",
"id": "rm3936529408",
"url": "https://m.media-amazon.com/images/M/MV5BOTU2MTI0NTIyNV5BMl5BanBnXkFtZTcwMTA4Nzc3OA@@._V1_.jpg",
"height": 576,
"width": 384
}
}
},
{
"__typename": "Cast",
"characters": [
{
"id": "Praetorian Jack",
"name": "Praetorian Jack"
}
],
"name": {
"__typename": "Name",
"id": "nm0121895",
"nameText": {
"text": "Tom Burke"
},
"primaryImage": {
"__typename": "Image",
"id": "rm2251074304",
"url": "https://m.media-amazon.com/images/M/MV5BMjAxMjk4MjgyMl5BMl5BanBnXkFtZTcwODk1MjgxOA@@._V1_.jpg",
"height": 2048,
"width": 1365
}
}
},
{
"__typename": "Cast",
"characters": [
{
"id": "Young Furiosa",
"name": "Young Furiosa"
}
],
"name": {
"__typename": "Name",
"id": "nm10752061",
"nameText": {
"text": "Alyla Browne"
},
"primaryImage": {
"__typename": "Image",
"id": "rm3576654337",
"url": "https://m.media-amazon.com/images/M/MV5BN2YyM2I3ODctMzc0Mi00MGEyLTg0N2EtM2U2ODUxMTMxY2RiXkEyXkFqcGc@._V1_.jpg",
"height": 6720,
"width": 4480
}
}
}
]
}
],
"credits": {
"__typename": "CreditConnection",
"edges": [
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "The History Man",
"name": "The History Man"
}
],
"name": {
"__typename": "Name",
"id": "nm0792964",
"nameText": {
"text": "George Shevtsov"
},
"primaryImage": {
"__typename": "Image",
"id": "rm1541371649",
"url": "https://m.media-amazon.com/images/M/MV5BNTAxMGUxY2ItYTBmMy00MGExLWI3MjQtZjI5ODRmMjRiMGQwXkEyXkFqcGc@._V1_.jpg",
"height": 530,
"width": 355
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Immortan Joe",
"name": "Immortan Joe"
},
{
"id": "Rizzdale Pell",
"name": "Rizzdale Pell"
}
],
"name": {
"__typename": "Name",
"id": "nm0401522",
"nameText": {
"text": "Lachy Hulme"
},
"primaryImage": {
"__typename": "Image",
"id": "rm2136808193",
"url": "https://m.media-amazon.com/images/M/MV5BNDk5YmQzMjQtM2Y4NC00Yjc3LWFjZGQtMTUzZjE4MDFkZDAwXkEyXkFqcGc@._V1_.jpg",
"height": 762,
"width": 761
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "The People Eater",
"name": "The People Eater"
}
],
"name": {
"__typename": "Name",
"id": "nm0397398",
"nameText": {
"text": "John Howard"
},
"primaryImage": {
"__typename": "Image",
"id": "rm1105955329",
"url": "https://m.media-amazon.com/images/M/MV5BODA2YWYxYmYtMjNkZi00M2NjLTk4MTEtN2ZjMDIwNmRiNzQzXkEyXkFqcGc@._V1_.jpg",
"height": 375,
"width": 500
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Organic Mechanic",
"name": "Organic Mechanic"
}
],
"name": {
"__typename": "Name",
"id": "nm0760151",
"nameText": {
"text": "Angus Sampson"
},
"primaryImage": {
"__typename": "Image",
"id": "rm1551919361",
"url": "https://m.media-amazon.com/images/M/MV5BMDNjNWQyYzctNmU3YS00ZGRiLWE4YzEtMjNmOTViMmU2NmI2XkEyXkFqcGc@._V1_.jpg",
"height": 4986,
"width": 3399
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Mary Jabassa",
"name": "Mary Jabassa"
}
],
"name": {
"__typename": "Name",
"id": "nm9471695",
"nameText": {
"text": "Charlee Fraser"
},
"primaryImage": {
"__typename": "Image",
"id": "rm2552777473",
"url": "https://m.media-amazon.com/images/M/MV5BMTA3ZDk4NTgtNjk3My00ZDJlLTlkMjItNDI2ZjMxMGQ1YjJkXkEyXkFqcGc@._V1_.jpg",
"height": 1282,
"width": 1283
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Vuvalini General",
"name": "Vuvalini General"
},
{
"id": "Mr. Norton",
"name": "Mr. Norton"
}
],
"name": {
"__typename": "Name",
"id": "nm0665235",
"nameText": {
"text": "Elsa Pataky"
},
"primaryImage": {
"__typename": "Image",
"id": "rm159031296",
"url": "https://m.media-amazon.com/images/M/MV5BMTAyNjU4MzkyNzleQTJeQWpwZ15BbWU3MDk2NTQ0Mjk@._V1_.jpg",
"height": 500,
"width": 333
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Rictus Erectus",
"name": "Rictus Erectus"
}
],
"name": {
"__typename": "Name",
"id": "nm0428923",
"nameText": {
"text": "Nathan Jones"
},
"primaryImage": {
"__typename": "Image",
"id": "rm2402700033",
"url": "https://m.media-amazon.com/images/M/MV5BZDAwMzlhMDMtMWQwZi00ZmU5LTllNWYtYzA2ZDMzODVhOGZjXkEyXkFqcGc@._V1_.jpg",
"height": 883,
"width": 883
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Scrotus",
"name": "Scrotus"
}
],
"name": {
"__typename": "Name",
"id": "nm2890541",
"nameText": {
"text": "Josh Helman"
},
"primaryImage": {
"__typename": "Image",
"id": "rm4226228224",
"url": "https://m.media-amazon.com/images/M/MV5BZGM0YTczNTEtODVhYy00MmIyLWI5MDItMzQ4ZmZhMWQ0ZTVlXkEyXkFqcGc@._V1_.jpg",
"height": 800,
"width": 1920
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Toe Jam",
"name": "Toe Jam"
}
],
"name": {
"__typename": "Name",
"id": "nm0275913",
"nameText": {
"text": "David Field"
},
"primaryImage": {
"__typename": "Image",
"id": "rm3178867202",
"url": "https://m.media-amazon.com/images/M/MV5BODlmOGYyZDktNTQ5Ny00Y2M2LWE0YjEtMjdjZTM4MzM3Zjk3XkEyXkFqcGc@._V1_PT1.0_CR135,66,689,1033_.jpg",
"height": 1033,
"width": 689
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Vulture",
"name": "Vulture"
}
],
"name": {
"__typename": "Name",
"id": "nm2738931",
"nameText": {
"text": "Rahel Romahn"
},
"primaryImage": {
"__typename": "Image",
"id": "rm2016557569",
"url": "https://m.media-amazon.com/images/M/MV5BNDg3YmVlYjgtMTc4Zi00Zjg0LTk5OTYtZDkzNjdhYzI4M2NkXkEyXkFqcGc@._V1_.jpg",
"height": 1800,
"width": 1440
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Smeg",
"name": "Smeg"
}
],
"name": {
"__typename": "Name",
"id": "nm0172259",
"nameText": {
"text": "David Collins"
},
"primaryImage": {
"__typename": "Image",
"id": "rm2988861185",
"url": "https://m.media-amazon.com/images/M/MV5BMjdkMzgzODgtNzY1NC00YTFjLWFhN2QtOWFiNDQ0ZDk1OWQ2XkEyXkFqcGc@._V1_CR254,1,3121,4681_.jpg",
"height": 4681,
"width": 3121
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "The Octoboss",
"name": "The Octoboss"
}
],
"name": {
"__typename": "Name",
"id": "nm2377520",
"nameText": {
"text": "Goran D. Kleut"
},
"primaryImage": {
"__typename": "Image",
"id": "rm2519449600",
"url": "https://m.media-amazon.com/images/M/MV5BMTkyNTc3NzAzNV5BMl5BanBnXkFtZTgwMTc1NTA0MjE@._V1_.jpg",
"height": 6169,
"width": 4969
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Big Jilly",
"name": "Big Jilly"
}
],
"name": {
"__typename": "Name",
"id": "nm11379573",
"nameText": {
"text": "CJ Bloomfield"
},
"primaryImage": null
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Fang",
"name": "Fang"
}
],
"name": {
"__typename": "Name",
"id": "nm2158275",
"nameText": {
"text": "Matuse"
},
"primaryImage": {
"__typename": "Image",
"id": "rm1557408001",
"url": "https://m.media-amazon.com/images/M/MV5BYzE4YjY3ZTUtNWYyOS00NTgxLThkZGQtMzllN2MyNGM5NzI3XkEyXkFqcGc@._V1_.jpg",
"height": 2318,
"width": 1668
}
}
}
},
{
"node": {
"__typename": "Cast",
"characters": [
{
"id": "Mr. Harley",
"name": "Mr. Harley"
}
],
"name": {
"__typename": "Name",
"id": "nm1345123",
"nameText": {
"text": "Ian Roberts"
},
"primaryImage": {
"__typename": "Image",
"id": "rm3408989697",
"url": "https://m.media-amazon.com/images/M/MV5BMmMyOGRkMDQtYmNmOC00MzlmLThhN2MtNjc3YzU2YzA0MGU5XkEyXkFqcGc@._V1_.jpg",
"height": 3418,
"width": 5074
}
}
}
}
],
"total": 1959
}
}
}
}💡 提示:为简化展示,列表类数据样例仅保留 1-2 条记录,实际返回条数以接口响应为准。
