面向开发者的 10 大免费 Movie API (2026)
最适合获取电影和电视节目数据的免费 API
开始使用 Hypereal 构建
通过单个 API 访问 Kling、Flux、Sora、Veo 等。免费积分开始,扩展到数百万。
无需信用卡 • 10万+ 开发者 • 企业级服务
2026年面向开发者的 10 大免费电影 API
正在开发电影应用、推荐引擎或娱乐仪表板?你需要一个可靠的电影 API。本指南涵盖了 2026 年可用的 10 个最佳免费电影和电视剧 API,并为每个 API 提供了代码示例。
快速对比
| API | 免费额度 | 频率限制 | 电视剧 | 图片 | 评分 |
|---|---|---|---|---|---|
| TMDB | 无限制 | 40 次请求/10秒 | 是 | 是 | 是 |
| OMDB | 1,000 次/天 | 1,000 次/天 | 是 | 海报 | 是 (IMDb) |
| TVmaze | 无限制 | 20 次请求/10秒 | 是 | 是 | 是 |
| Trakt | 1,000 次/天 | 1,000 次/天 | 是 | 否 | 是 |
| JustWatch | 非官方 | 视情况而定 | 是 | 是 | 是 |
| Watchmode | 1,000 次/月 | 视情况而定 | 是 | 是 | 是 |
| Movie of the Night | 10,000 次/月 | 视情况而定 | 是 | 是 | 是 |
| IMDb (非官方) | 视情况而定 | 视情况而定 | 是 | 是 | 是 |
| Streaming Availability | 100 次/天 | 100 次/天 | 是 | 是 | 是 |
| Kitsu | 无限制 | 适中 | 动漫 | 是 | 是 |
1. TMDB (The Movie Database) —— 综合最佳
TMDB 是免费电影 API 的金标准。它拥有最全面的数据库、优秀的文档和慷慨的免费层级。
核心功能:
- 900,000+ 部电影和 160,000+ 部电视剧
- 高分辨率图片和海报
- 演员、剧组和制作细节
- 支持 40 多种语言
- 社区驱动的数据
获取 API 密钥
- 在 themoviedb.org 创建免费账户
- 进入 Settings > API(设置 > API)请求 API 密钥
- 选择“Developer”(开发者)以获得免费访问权限
代码示例
import requests
API_KEY = "your_tmdb_api_key"
BASE_URL = "https://api.themoviedb.org/3"
# 搜索电影
response = requests.get(f"{BASE_URL}/search/movie", params={
"api_key": API_KEY,
"query": "Inception",
"language": "en-US"
})
results = response.json()["results"]
for movie in results[:3]:
print(f"{movie['title']} ({movie['release_date'][:4]}) - Rating: {movie['vote_average']}")
// Node.js / fetch
const API_KEY = "your_tmdb_api_key";
const response = await fetch(
`https://api.themoviedb.org/3/search/movie?api_key=${API_KEY}&query=Inception`
);
const data = await response.json();
data.results.slice(0, 3).forEach(movie => {
console.log(`${movie.title} (${movie.release_date.slice(0, 4)}) - ${movie.vote_average}`);
});
获取热门电影
# 获取本周热门电影
response = requests.get(f"{BASE_URL}/trending/movie/week", params={
"api_key": API_KEY
})
trending = response.json()["results"]
for movie in trending[:5]:
print(f"Trending: {movie['title']} - {movie['vote_average']}/10")
2. OMDB (Open Movie Database) —— 获取 IMDb 数据的最佳选择
OMDB 让你通过单次 API 调用即可直接访问 IMDb 评分、Rotten Tomatoes(烂番茄)分数和 Metacritic 数据。
免费额度: 每天 1,000 次请求
代码示例
import requests
API_KEY = "your_omdb_api_key" # 在 omdbapi.com 获取免费密钥
# 按标题搜索
response = requests.get("https://www.omdbapi.com/", params={
"apikey": API_KEY,
"t": "The Dark Knight",
"type": "movie"
})
movie = response.json()
print(f"Title: {movie['Title']}")
print(f"IMDb Rating: {movie['imdbRating']}")
print(f"Rotten Tomatoes: {movie['Ratings'][1]['Value']}")
print(f"Metacritic: {movie['Metascore']}")
const response = await fetch(
`https://www.omdbapi.com/?apikey=YOUR_KEY&t=The+Dark+Knight&type=movie`
);
const movie = await response.json();
console.log(`${movie.Title} - IMDb: ${movie.imdbRating}, RT: ${movie.Ratings[1]?.Value}`);
3. TVmaze —— 电视剧数据最佳选择
TVmaze 专注于电视剧数据,提供深入的剧集级信息、排期和演职人员数据。基本使用无需 API 密钥。
代码示例
import requests
# 基本接口无需 API 密钥
response = requests.get("https://api.tvmaze.com/search/shows", params={
"q": "Breaking Bad"
})
shows = response.json()
for item in shows[:3]:
show = item["show"]
print(f"{show['name']} - Rating: {show['rating']['average']}")
print(f" Genres: {', '.join(show['genres'])}")
print(f" Status: {show['status']}")
获取剧集排期
# 获取美国今天的电视节目单
response = requests.get("https://api.tvmaze.com/schedule", params={
"country": "US"
})
episodes = response.json()
for ep in episodes[:5]:
show_name = ep["show"]["name"]
print(f"{show_name} - S{ep['season']}E{ep['number']}: {ep['name']}")
4. Trakt —— 观看历史和推荐的最佳选择
Trakt 专注于用户观看历史、清单和社交功能。非常适合构建个性化推荐引擎。
免费额度: 每天 1,000 次 API 调用
import requests
headers = {
"Content-Type": "application/json",
"trakt-api-version": "2",
"trakt-api-key": "your_client_id"
}
# 获取热门电影
response = requests.get(
"https://api.trakt.tv/movies/trending",
headers=headers
)
trending = response.json()
for item in trending[:5]:
movie = item["movie"]
print(f"{movie['title']} ({movie['year']}) - Watchers: {item['watchers']}")
5. JustWatch (非官方) —— 流媒体可用性最佳选择
JustWatch 追踪电影和剧集在哪些流媒体平台上架。虽然没有官方免费 API,但社区维护的库提供了访问权限。
# 使用 justwatch-python 包
# pip install justwatch
from justwatch import JustWatch
jw = JustWatch(country="US")
results = jw.search_for_item(query="Dune")
for item in results["items"][:3]:
title = item["title"]
offers = item.get("offers", [])
platforms = set(o["package_short_name"] for o in offers)
print(f"{title} - Available on: {', '.join(platforms)}")
6. Watchmode —— 获取流媒体来源数据的最佳选择
Watchmode 提供关于哪些流媒体服务携带特定内容的结构化数据,包括直接的深层链接。
免费额度: 每月 1,000 次 API 调用
import requests
API_KEY = "your_watchmode_key"
response = requests.get(f"https://api.watchmode.com/v1/search/", params={
"apiKey": API_KEY,
"search_field": "name",
"search_value": "Stranger Things"
})
results = response.json()["title_results"]
for title in results[:3]:
print(f"{title['name']} ({title['year']}) - Type: {title['type']}")
7. Movie of the Night API —— 探索发现最佳选择
Movie of the Night 专注于内容发现,提供精心策划的推荐和过滤功能。
免费额度: 每月 10,000 次请求
import requests
headers = {"x-rapidapi-key": "your_rapidapi_key"}
response = requests.get(
"https://movie-of-the-night.p.rapidapi.com/search",
headers=headers,
params={"query": "sci-fi", "type": "movie"}
)
for movie in response.json()[:5]:
print(f"{movie['title']} - Streaming on: {', '.join(movie.get('services', []))}")
8. IMDb Unofficial APIs —— 获取原始 IMDb 数据的最佳选择
RapidAPI 上有几个非官方 IMDb API,它们通过爬取或镜像 IMDb 数据来提供信息。
import requests
headers = {
"x-rapidapi-key": "your_rapidapi_key",
"x-rapidapi-host": "imdb8.p.rapidapi.com"
}
response = requests.get(
"https://imdb8.p.rapidapi.com/auto-complete",
headers=headers,
params={"q": "Oppenheimer"}
)
results = response.json()["d"]
for item in results[:3]:
print(f"{item['l']} ({item.get('y', 'N/A')}) - {item.get('s', '')}")
警告: 非官方 API 可能会在不通知的情况下失效。生产环境应用请使用 TMDB 或 OMDB。
9. Streaming Availability API —— 跨平台搜索最佳选择
此 API 汇总了全球 60 多个国家 150 多种服务的流媒体数据。
免费额度: 在 RapidAPI 上每天 100 次请求
import requests
headers = {
"x-rapidapi-key": "your_rapidapi_key",
"x-rapidapi-host": "streaming-availability.p.rapidapi.com"
}
response = requests.get(
"https://streaming-availability.p.rapidapi.com/shows/search/filters",
headers=headers,
params={
"country": "us",
"catalogs": "netflix",
"genres": "action",
"order_by": "rating",
"output_language": "en"
}
)
for show in response.json()["shows"][:5]:
print(f"{show['title']} - Rating: {show.get('rating', 'N/A')}")
10. Kitsu —— 动漫最佳选择
Kitsu 是获取动漫和漫画数据的最佳免费 API。无需 API 密钥。
import requests
response = requests.get("https://kitsu.io/api/edge/anime", params={
"filter[text]": "Attack on Titan",
"page[limit]": 5
})
for anime in response.json()["data"]:
attrs = anime["attributes"]
print(f"{attrs['canonicalTitle']} - Rating: {attrs['averageRating']}")
print(f" Episodes: {attrs['episodeCount']}, Status: {attrs['status']}")
如何选择合适的 API
参考以下决策树:
- 开发通用电影应用? 从 TMDB 开始 —— 它包含了一切。
- 需要 IMDb/烂番茄评分? 使用 OMDB 作为补充。
- 开发“在哪里观看”功能? 使用 Streaming Availability 或 Watchmode。
- 电视剧排期? TVmaze 是不二之选。
- 动漫应用? Kitsu 是为此量身定制的。
- 推荐引擎? 将 TMDB 数据与 Trakt 用户行为结合。
构建一个完整的电影应用
对于大多数项目,你会希望结合使用两到三个 API:
import requests
class MovieService:
def __init__(self, tmdb_key, omdb_key):
self.tmdb_key = tmdb_key
self.omdb_key = omdb_key
def get_movie_details(self, title):
# 从 TMDB 获取丰富数据
tmdb = requests.get("https://api.themoviedb.org/3/search/movie", params={
"api_key": self.tmdb_key,
"query": title
}).json()["results"][0]
# 从 OMDB 获取评分
omdb = requests.get("https://www.omdbapi.com/", params={
"apikey": self.omdb_key,
"t": title
}).json()
return {
"title": tmdb["title"],
"overview": tmdb["overview"],
"poster": f"https://image.tmdb.org/t/p/w500{tmdb['poster_path']}",
"tmdb_rating": tmdb["vote_average"],
"imdb_rating": omdb.get("imdbRating"),
"rotten_tomatoes": next(
(r["Value"] for r in omdb.get("Ratings", [])
if r["Source"] == "Rotten Tomatoes"), None
),
}
# 使用示例
service = MovieService("tmdb_key", "omdb_key")
movie = service.get_movie_details("Dune: Part Two")
print(movie)
添加 AI 驱动的功能
想超越基础电影数据吗?你可以使用 AI API 为你的电影应用添加智能化功能:
- 根据剧情描述生成 AI 电影摘要
- 海报风格迁移 或 AI 增强的缩略图
- 电影评论的 语音旁白
Hypereal AI 提供图像生成、视频创作和文本转语音 API,能与电影数据完美搭配。例如,生成自定义电影海报变体或创建 AI 配音的评论视频。注册即可获得免费初始积分进行尝试。
结论
在大多数用例中,TMDB 是明显的赢家 —— 它免费、全面且记录详尽。配合使用 OMDB 获取评分数据,以及流媒体可用性 API 获取“在何处观看”功能。
此列表中的所有 10 个 API 都提供了足以用于开发和小型生产环境的免费层级。从 TMDB 开始,根据需要添加其他 API,你就能在不花一分钱的情况下拥有完整的电影数据栈。
