最后更新
更新日志/categories5 credits per call类别
magichour.ai 模板主页列出的模板类别,按网站顺序排列:slug、显示名称和页面 URL。每个 slug 都可作为 `category` 传给 /templates 和 /explore。
Authorization: Bearer <key> on every request.Parameters
This endpoint takes no parameters.
curl "https://api.maviapi.com/v1/sites/magichour/categories" \-H "Authorization: Bearer $MAVI_KEY"
[
{
"slug": "popular",
"name": "Popular",
"url": "https://magichour.ai/templates/popular"
}
]Get all the data, no code
Collect every page of GET /categories into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.
Use Magic Hour API from Claude, ChatGPT and your coding tools
Add this URL as a custom connector and sign in to maviapi. Nothing to install.
https://mcp.maviapi.com/mcpOr run it locally, with each endpoint of Magic Hour API as its own tool:
claude mcp add maviapi -e MAVIAPI_TOOLS=magichour -- npx -y '@maviapi/mcp'Import Magic Hour API into Postman and other tools
How to importPaste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.
- OpenAPI 3.1
https://api.maviapi.com/v1/apis/magichour/openapi.json - Postman
https://api.maviapi.com/v1/apis/magichour/postman.json
The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.
使用 Magic Hour API 进行开发
选择一个端点开始
- 类别
GET /categoriesmagichour.ai 模板主页列出的模板类别,按网站顺序排列:slug、显示名称和页面 URL。每个 slug 都可作为 `category` 传给 /templates 和 /explore。
- 模板
GET /templatesmagichour.ai 某个类别下的模板,与网站列出的一致:'all' 为模板主页(约 60 个热门模板),其他类别为对应页面的前约 20 个模板。每个模板包含 id、name、description、url、project_type、source_type、tags、used_count、size、created_at(UTC)、预览和输出媒体的 URL,以及预填的生成设置。
GET /templates 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 category string / query 否 category slug (see /categories); 'all' = the templates hub 可选值: all, popular, new, animation, video-to-video, image-to-video, text-to-video, face-swap, character-replace, lip-sync, talking-photo, music-video, memes, movies, sports, tiktok, bollywood, transition, kpop, ai-image-editor, clothes-changer, ai-video-effects, ai-dance-video, camera-motion, ai-transformation-video, anime-video, video-game, ai-video-styles. project_type string / query 否 keep only templates of this generation type, e.g. FACE_SWAP tag string / query 否 keep only templates carrying this tag (case-insensitive), e.g. KPOP, MEMES, POPULAR, TIKTOK sort string / query 否 'default' = the site's order, 'most_used' = most used first, 'newest' = newest first 可选值: default, most_used, newest. 响应字段 字段 类型 说明 category string category_name string count integer templates object[] templates[].id string templates[].name string templates[].description string templates[].url string templates[].project_type string templates[].source_type string templates[].tags string[] templates[].used_count integer templates[].width integer templates[].height integer templates[].created_at string templates[].author null templates[].preview_url string templates[].output_urls string[] templates[].settings object templates[].settings.fps integer templates[].settings.endSeconds integer templates[].settings.startSeconds integer templates[].settings.videoFile_url string templates[].settings.initialImage_url string pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 探索
GET /explore一次调用完成发现:返回某次搜索(传入 q 时)或某个类别下的模板,其中前 `details` 个模板附带 `details` = {content: 指南内容(同 /templates/{id}),related_templates: [...]};其余模板的 details 为 null。
GET /explore 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 q string / query 否 free-text search; when set the search is used and category is ignored category string / query 否 category slug to browse when q is empty (see /categories); 'all' = the templates hub 可选值: all, popular, new, animation, video-to-video, image-to-video, text-to-video, face-swap, character-replace, lip-sync, talking-photo, music-video, memes, movies, sports, tiktok, bollywood, transition, kpop, ai-image-editor, clothes-changer, ai-video-effects, ai-dance-video, camera-motion, ai-transformation-video, anime-video, video-game, ai-video-styles. details integer / query 否 how many of the top results (0-5) to enrich with full detail project_type string / query 否 only templates of this generation type, e.g. FACE_SWAP tag string / query 否 only templates carrying this tag (case-insensitive), e.g. KPOP, MEMES, POPULAR, TIKTOK sort string / query 否 'default' = the site's order, 'most_used' = most used first, 'newest' = newest first 可选值: default, most_used, newest. 响应字段 字段 类型 说明 flow string query null category string details_requested integer count integer templates object[] templates[].id string templates[].name string templates[].description string templates[].url string templates[].project_type string templates[].source_type string templates[].tags string[] templates[].used_count integer templates[].width integer templates[].height integer templates[].created_at string templates[].author null templates[].preview_url string templates[].output_urls string[] templates[].settings object templates[].settings.fps integer templates[].settings.endSeconds integer templates[].settings.startSeconds integer templates[].settings.videoFile_url string templates[].settings.initialImage_url string templates[].details object templates[].details.content object templates[].details.content.overview string templates[].details.content.what_it_does string templates[].details.content.who_its_for string templates[].details.content.summary string templates[].details.content.how_to object[] templates[].details.content.how_to[].title string templates[].details.content.how_to[].description string templates[].details.content.use_cases object[] templates[].details.content.use_cases[].title string templates[].details.content.use_cases[].description string templates[].details.content.use_cases[].bullets string[] templates[].details.content.best_practices object[] templates[].details.content.best_practices[].title string templates[].details.content.best_practices[].description string templates[].details.content.faqs object[] templates[].details.content.faqs[].question string templates[].details.content.faqs[].answer string templates[].details.content.related_tools object[] templates[].details.content.related_tools[].name string templates[].details.content.related_tools[].url string templates[].details.content.related_tools[].description string templates[].details.related object[] templates[].details.related[].id string templates[].details.related[].name string templates[].details.related[].url string pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 搜索
GET /search与自由文本查询匹配的模板,来自 magichour.ai 自身的模板搜索(取其前 20 条结果,未指定排序时按其相关性排序)。模板字段同 /templates。
GET /search 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 q string / query 否 search text, e.g. 'dance' project_type string / query 否 only templates of this generation type (applied in the site's search), e.g. FACE_SWAP tag string / query 否 keep only templates carrying this tag (case-insensitive), e.g. KPOP, MEMES, POPULAR, TIKTOK sort string / query 否 'default' = the site's order, 'most_used' = most used first, 'newest' = newest first 可选值: default, most_used, newest. 响应字段 字段 类型 说明 query string count integer templates object[] templates[].id string templates[].name string templates[].description string templates[].url string templates[].project_type string templates[].source_type string templates[].tags string[] templates[].used_count integer templates[].width integer templates[].height integer templates[].created_at string templates[].author null templates[].preview_url string templates[].output_urls string[] templates[].settings object templates[].settings.fps integer templates[].settings.model string templates[].settings.prompt string templates[].settings.version string templates[].settings.endSeconds integer templates[].settings.resolution string templates[].settings.aspectRatio string templates[].settings.startSeconds integer pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer - 模板
GET /templates/{id}单个 magichour.ai 模板的完整信息:包含 /templates 的全部字段及其指南内容(概述、功能说明、适用人群、摘要、操作步骤、使用场景、最佳实践、相关工具、常见问题;纯文本,模板没有指南时为 null),`related`:网站与该模板一同展示的相关模板(字段同 /templates),以及 `source_url`:读取该模板所用的 magichour.ai 页面。
GET /templates/{id} 的参数和响应字段
请求参数 名称 类型 / 位置 必填 说明 id string / path 是 template id, or the id-slug from a template url (e.g. cmndlx5bh000kqe7u7n2fmy3v-bullet-time) 响应字段 字段 类型 说明 id string name string description string url string project_type string source_type string tags string[] used_count integer width integer height integer created_at string author null preview_url string output_urls string[] settings object settings.fps integer settings.lora string settings.model string settings.version string settings.endSeconds integer settings.resolution string settings.startSeconds integer settings.initialImage_url string source_url string content object content.overview string content.what_it_does string content.who_its_for string content.summary string content.how_to object[] content.how_to[].title string content.how_to[].description string content.use_cases object[] content.use_cases[].title string content.use_cases[].description string content.use_cases[].bullets string[] content.best_practices object[] content.best_practices[].title string content.best_practices[].description string content.faqs object[] content.faqs[].question string content.faqs[].answer string content.related_tools object[] content.related_tools[].name string content.related_tools[].url string content.related_tools[].description string related object[] related[].id string related[].name string related[].description string related[].url string related[].project_type string related[].source_type string related[].tags string[] related[].used_count integer related[].width integer related[].height integer related[].created_at string related[].author null related[].preview_url string related[].output_urls string[] related[].settings object pagination object pagination.count integer pagination.has_more boolean pagination.next_cursor null fetched_at string age integer
将 Magic Hour 数据导出为 CSV
下面的每个列表都可以下载为 CSV 文件,每条记录一行。用上方控制台下面的 "Get all the data, no code" 卡片把列表收集到数据集中。数据集会逐页读取列表,之后可下载为 CSV、JSON 或 JSONL。
| 列表 | CSV 列 |
|---|---|
模板GET /templates | id, name, description, url, project_type, source_type, tags, used_count, width, height, created_at, author, preview_url, output_urls, settings |
探索GET /explore | id, name, description, url, project_type, source_type, tags, used_count, width, height, created_at, author, preview_url, output_urls, settings, details |
搜索GET /search | id, name, description, url, project_type, source_type, tags, used_count, width, height, created_at, author, preview_url, output_urls, settings |
模板GET /templates/{id} | id, name, description, url, project_type, source_type, tags, used_count, width, height, created_at, author, preview_url, output_urls, settings |
嵌套的值(列表或对象)以 JSON 写入同一个单元格。 数据集和导出如何工作
Magic Hour API 常见问题
能获取什么数据、费用多少、如何调用。
Magic Hour 有官方 API 吗?
有,Magic Hour 提供自己的 API:Magic Hour API(核实日期:2026-11-25)。本页的 Magic Hour API 与它无关,是非官方 API:它是 maviapi 针对 magichour.ai 上的公开数据提供的独立托管 API,并非由 Magic Hour 开发、认可或支持。
Magic Hour API 可以获取哪些数据?
Magic Hour API 有 5 个端点。每个端点都返回 JSON,参数和字段见上方的文档:
- GET
/categories: magichour.ai 模板主页列出的模板类别,按网站顺序排列:slug、显示名称和页面 URL。 - GET
/templates: magichour.ai 某个类别下的模板,与网站列出的一致:'all' 为模板主页(约 60 个热门模板),其他类别为对应页面的前约 20 个模板。 - GET
/explore: 一次调用完成发现:返回某次搜索(传入 q 时)或某个类别下的模板,其中前 `details` 个模板附带 `details` = {content: 指南内容(同 /templates/{id}),related_templates: [...]};其余模板的 details 为 null。 - GET
/search: 与自由文本查询匹配的模板,来自 magichour.ai 自身的模板搜索(取其前 20 条结果,未指定排序时按其相关性排序)。 - GET
/templates/{id}: 单个 magichour.ai 模板的完整信息:包含 /templates 的全部字段及其指南内容(概述、功能说明、适用人群、摘要、操作步骤、使用场景、最佳实践、相关工具、常见问题;纯文本,模板没有指南时为 null),`related`:网站与该模板一同展示的相关模板(字段同 /templates),以及…
Magic Hour API 的价格是多少?
调用用您 maviapi 套餐中的积分支付,只有成功的调用才会计费。此 API 的每个端点每次调用消耗 5 个积分。在 Hobby 套餐下(每月 $49,含 250,000 个积分),1,000 次调用约 $0.98。失败的调用不收费。Free 套餐每月提供 1,000 个积分,无需信用卡。超出部分请查看套餐和积分价格。
如何调用 Magic Hour API?
向端点发送 HTTPS 请求,并在 Authorization 请求头中带上您的 API 密钥。例如 GET /categories:
curl 'https://api.maviapi.com/v1/sites/magichour/categories' \
-H "Authorization: Bearer $MAVI_KEY"在您的 API 密钥页面创建密钥,或者先在上方的控制台中用免费测试密钥试用任意端点。
以 JSON 获取 Magic Hour 数据有哪些方式?
以 JSON 获取 Magic Hour 数据的每种方式适合不同的需求:
- Magic Hour API: 需要写入权限、账号数据或与 Magic Hour 签订协议时更合适。
- 自己写爬虫: 完全由自己掌控,不依赖任何服务商,但解析、被拦截的请求以及 magichour.ai 每次改版后的修复都要自己负责。更适合从很少变化的页面一次性获取数据。
- Apify: 一个 Actor 市场,Actor 由您自己运行,输入、输出和价格由各个 Actor 决定。当已有 Actor 能返回您需要的数据,或者您想托管自己的代码时更合适。参见maviapi 与 Apify 的对比。
- RapidAPI: 一个汇集了众多提供方 API 的平台,用一个 RapidAPI 密钥调用,每个 API 单独定价。当您已经在使用该平台,并且其中某个 API 能满足需求时更合适。来源:RapidAPI docs。
- maviapi: 本页的 Magic Hour API:5 个带文档的端点、公开的响应结构,以及一个可用于整个目录的密钥。当这些数据是您产品的一部分,而您不想维护爬虫时更合适。
magichour.ai 改版后会怎样?
更新会破坏我的 Magic Hour API 集成吗?
不会。您正在使用的端点,其结构永远不会改变:新的字段、可选参数和端点只会加在旁边,会破坏调用的变更则作为新端点发布。请忽略您不认识的响应字段,新内容请关注更新日志。
相关 API
- Pixelbin API
以 JSON 形式提供 Pixelbin 的公开目录:全部图像转换(标识符、参数、允许的取值、默认值、示例)、全部 AI 工具(描述、定价、常见问题)和全部博客文章(全文),支持搜索、筛选和分页,另有一个集搜索与详情于一体的…
- Upsampler API
以 JSON 形式提供 Upsampler.com 的 AI 模型目录:收录其全部图像/视频生成、放大和编辑模型,含评分、速度、积分价格、基准测试排名、优势、提示词技巧和示例输出,另有按工具划分的模型对比和 Upsampler 博客。
- Tripadvisor API
来自 Tripadvisor 的行程规划数据:支持地点搜索,并可按地点(geo_id)获取景点、餐厅和酒店,包含评分、评论、价格和坐标。先用 /search 解析地名,再通过…