影院放映时间

GET /3/movie/{movie_id}/showtimes?country=RU 返回某国家放映该电影的影院及各场次。不带 country 时只返回各国数量。覆盖因国家和影片而异,results 为空表示没有已知数据。

更新于 以 Markdown 查看

获取电影的放映时间

GET /3/movie/{movie_id}/showtimes?country=RU 返回在某个国家放映该电影的影院,以及各影院带日期的场次。country 参数接受两位代码,大小写均可。覆盖范围因国家和影片而异,所以已知的地方有数据,未知的地方缺失。只返回从今天起的日期。

示例请求俄罗斯的《搏击俱乐部》,并处理空结果。

bashjspyphpgo
curl -sf "https://api.amodb.dev/3/movie/550/showtimes?country=RU" \
  -H "Authorization: Bearer $AMODB_KEY"
const url = 'https://api.amodb.dev/3/movie/550/showtimes?country=RU';
const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.AMODB_KEY}` } });
if (!res.ok) throw new Error(`amodb returned ${res.status}`);
const data = await res.json();
if (data.results.length === 0) console.log('no showtimes known');
for (const venue of data.results) {
  for (const s of venue.showtimes) {
    console.log(venue.name, venue.city, s.start, s.formats.join(','), s.booking_url);
  }
}
import os
import requests

r = requests.get(
    "https://api.amodb.dev/3/movie/550/showtimes",
    params={"country": "RU"},
    headers={"Authorization": f"Bearer {os.environ['AMODB_KEY']}"},
    timeout=10,
)
r.raise_for_status()
results = r.json()["results"]
if not results:
    print("no showtimes known")
for venue in results:
    for s in venue["showtimes"]:
        print(venue["name"], venue["city"], s["start"], ",".join(s["formats"]))
<?php
$url = 'https://api.amodb.dev/3/movie/550/showtimes?country=RU';
$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('AMODB_KEY')],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status !== 200) {
    throw new RuntimeException("amodb returned $status");
}
$results = json_decode($body, true)['results'];
if (!$results) {
    echo 'no showtimes known', PHP_EOL;
}
foreach ($results as $venue) {
    foreach ($venue['showtimes'] as $s) {
        echo $venue['name'], ' ', $s['start'], ' ', implode(',', $s['formats']), PHP_EOL;
    }
}
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"strings"
	"time"
)

type Venue struct {
	Name      string `json:"name"`
	City      string `json:"city"`
	Showtimes []struct {
		Start      string   `json:"start"`
		Formats    []string `json:"formats"`
		BookingURL string   `json:"booking_url"`
	} `json:"showtimes"`
}

func main() {
	url := "https://api.amodb.dev/3/movie/550/showtimes?country=RU"
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("AMODB_KEY"))
	client := &http.Client{Timeout: 10 * time.Second}
	res, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	if res.StatusCode != http.StatusOK {
		panic(res.Status)
	}
	var body struct {
		Results []Venue `json:"results"`
	}
	if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
		panic(err)
	}
	if len(body.Results) == 0 {
		fmt.Println("no showtimes known")
	}
	for _, v := range body.Results {
		for _, s := range v.Showtimes {
			fmt.Println(v.Name, v.City, s.Start, strings.Join(s.Formats, ","))
		}
	}
}

参数

  • movie_id路径必填
    数字形式的电影 ID,例如 550。
  • country查询
    两位国家代码,例如 RU。不带它时只得到各国汇总。region 是别名。
  • api_key查询二选一
    你的密钥。使用它,或使用 Authorization: Bearer 请求头。

响应字段

字段类型说明
idinteger电影 ID。
countrystring 或 null你请求的大写代码;country 缺失或不是两位字母时为 null。
resultsarray每个影院一个对象,按影院排序。没有已知数据或未传国家时为空。场次总数最多 1500。
results[].idinteger影院 ID。
results[].namestring影院名称。
results[].chainobjectkey 是院线键,name 是院线名称或 null。
results[].citystring 或 null城市。
results[].regionstring 或 null地区。
results[].addressstring 或 null街道地址。
results[].postal_codestring 或 null邮政编码。
results[].countrystring影院所在国家的代码。
results[].timezonestring 或 nullIANA 时区,例如 Europe/Moscow。
results[].latitude、results[].longitudenumber 或 null影院位置。
results[].phonestring 或 null电话号码。
results[].urlstring 或 null影院页面。
results[].showtimesarray该影院的场次,按开始时间排序。
results[].showtimes[].datestring日期,形如 2026-10-18。
results[].showtimes[].startstring影院当地时间的开始时间,形如 2026-10-18T21:40,没有 UTC 偏移。
results[].showtimes[].endstring 或 null影院当地时间的结束时间。
results[].showtimes[].auditoriumstring 或 null影厅名称。
results[].showtimes[].formatsarray of strings放映格式,例如 2D。
results[].showtimes[].tagsarray of strings额外标签。通常为空。
results[].showtimes[].audio、subtitles、languagestring 或 null已知时的音轨、字幕和语言信息。
results[].showtimes[].pricenumber 或 null票价。
results[].showtimes[].currencystring 或 nullprice 的币种。
results[].showtimes[].pricesany 或 null影院有多种价格时的价格详情。
results[].showtimes[].booking_urlstring 或 null订座链接。
results[].showtimes[].sold_outboolean场次售罄时为 true。
countriesarray各国汇总,见下文。

请按名称读取你用到的键,并跳过影院或场次对象中的额外键。目前许多字段为 null,因为并非每个影院都会提供它们。

示例响应

JSON
{
  "id": 550,
  "country": "RU",
  "results": [
    {
      "id": 1114,
      "name": "Мираж Синема НА БОЛЬШОМ",
      "chain": {
        "key": "mirage-ru",
        "name": "Мираж Синема"
      },
      "city": "Санкт-Петербург",
      "region": null,
      "address": "Большой пр. П.С., д. 35А",
      "postal_code": null,
      "country": "RU",
      "timezone": "Europe/Moscow",
      "latitude": null,
      "longitude": null,
      "phone": null,
      "url": "https://www.mirage.ru/spb/cinema/1/",
      "showtimes": [
        {
          "date": "2026-10-18",
          "start": "2026-10-18T21:40",
          "end": null,
          "auditorium": null,
          "formats": ["2D"],
          "tags": [],
          "audio": null,
          "subtitles": null,
          "language": null,
          "price": null,
          "currency": null,
          "prices": null,
          "booking_url": "https://www.mirage.ru/ticket_new/aca7b114-d587-4fc5-9df6-28568e8fa9b3/",
          "sold_out": false
        },
        {
          "date": "2026-10-19",
          "start": "2026-10-19T22:20",
          "end": null,
          "auditorium": "Зал №4",
          "formats": ["2D"],
          "tags": [],
          "audio": null,
          "subtitles": null,
          "language": null,
          "price": null,
          "currency": null,
          "prices": null,
          "booking_url": "https://www.mirage.ru/ticket_new/0c32e190-890a-4c81-a754-3300fefc4d5e/",
          "sold_out": false
        }
      ]
    }
  ],
  "countries": [
    {
      "country": "RU",
      "name": "Russia",
      "venues": 2,
      "cities": 1,
      "showtimes": 7,
      "first_day": "2026-10-18",
      "last_day": "2026-10-21"
    }
  ]
}

列表已缩减为 2 个影院中的 1 个、4 个场次中的 2 个。场次只存在于尚未过去的日期,所以这个响应每天都会变化。

获取各国汇总

不带 country 时,响应只有数量。results 保持为空,country 为 null。countries 数组最多列出 60 个仍有场次的国家,场次最多的排在最前。在请求影院之前,可用它了解某部作品在哪里上映。

curl
curl -sf "https://api.amodb.dev/3/movie/550/showtimes" \
  -H "Authorization: Bearer $AMODB_KEY"
JSON
{
  "id": 550,
  "country": null,
  "results": [],
  "countries": [
    {
      "country": "RU",
      "name": "Russia",
      "venues": 2,
      "cities": 1,
      "showtimes": 7,
      "first_day": "2026-10-18",
      "last_day": "2026-10-21"
    }
  ]
}
字段类型说明
countries[].countrystring两位代码,可直接用作 country 参数。
countries[].namestring英文国家名称。
countries[].venuesinteger有场次的影院数。
countries[].citiesinteger有场次的城市数。
countries[].showtimesinteger从今天起的场次数。
countries[].first_day、countries[].last_daystring有场次的第一天和最后一天。

没有数据的国家代码,例如这部电影的 country=US,会返回 country 为 US、空的 results 和相同的 countries 列表。哪里都没有场次的作品,例如剧集 1396,其响应中是 "countries": []。

把放映时间加入详情调用

append_to_response=showtimes 会把同样的数据块合并到详情响应的 showtimes 键下。请在同一个请求中传入 country 代码。该数据块保留自己的 id、country、results 和 countries 键。

请求结果
/3/movie/550?append_to_response=showtimes&country=RU电影记录加上俄罗斯的 showtimes 块
/3/movie/550?append_to_response=credits,showtimes&country=RU在同一次调用中加入演职员

它只算一个请求,所以同时展示演员和场次的电影页面只需一次调用。剧集有同样的接口:GET /3/tv/{tv_id}/showtimes。

与 now_playing 和 region 搭配

正在上映列表给你作品。放映时间接口给你某部作品的场次。在你的代码中把两者连起来。

步骤请求结果
1GET /3/movie/now_playing?region=RU&page=1每页最多 20 部电影,缓存 30 分钟
2对每个 ID 调用 GET /3/movie/{id}/showtimes?country=RU影院和时间(已知时)

下面的循环在达到套餐上限时重试一两次,等待 Retry-After 中的秒数。

JavaScript
const base = 'https://api.amodb.dev/3';
const headers = { Authorization: `Bearer ${process.env.AMODB_KEY}` };

async function get(path, retries = 2) {
  const res = await fetch(base + path, { headers });
  if (res.status === 429 && retries > 0) {
    const wait = Number(res.headers.get('Retry-After') ?? 60);
    await new Promise((resolve) => setTimeout(resolve, wait * 1000));
    return get(path, retries - 1);
  }
  if (!res.ok) throw new Error(`amodb returned ${res.status} for ${path}`);
  return res.json();
}

const playing = await get('/movie/now_playing?region=RU&page=1');
for (const movie of playing.results) {
  const data = await get(`/movie/${movie.id}/showtimes?country=RU`);
  if (data.results.length > 0) console.log(movie.title, data.results.length, 'venues');
}

一页 20 部作品就是 20 次放映时间请求。在每分钟 20 个请求的套餐上,这会用满整个窗口,所以请在你这一侧缓存结果。列表参数见热门与榜单。

错误

错误响应体遵循 TMDB:success、status_code 和 status_message。密钥错误时 status_code 为 7。

HTTPstatus_code何时出现
4017密钥缺失或错误。
40236套餐周期已结束。
40434没有该 ID 的电影。
42925超过每分钟请求数。请等待 Retry-After 秒。

没有放映时间不是错误:预期是状态 200 和空的 results 数组。缺失或无效的 country 也不是错误。见错误和速率限制。

实用说明

  • 覆盖范围因国家和影片而异。把空的 results 数组视为未知,而不是没有上映。
  • 原样展示 start。它是影院的当地时间,没有 UTC 偏移,访客期望看到的正是影院自己的时钟时间。
  • 放映时间在边缘缓存 30 分钟。不要为每次页面浏览都请求,并让你自己的缓存保持较短。
  • 同一地区的所有访客复用一份正在上映列表。它同样在边缘缓存 30 分钟。
  • 用 booking_url 把访客送到影院的订票页面。影院没有提供链接时它为 null。
  • 用例概览见影院放映时间 API,电影的其他数据见电影。