Midjourney 任务查询
curl --request GET \
--url https://www.geeknow.top/mj/task/{id}/fetch \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.geeknow.top/mj/task/{id}/fetch"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.geeknow.top/mj/task/{id}/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.geeknow.top/mj/task/{id}/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.geeknow.top/mj/task/{id}/fetch"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.geeknow.top/mj/task/{id}/fetch")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.geeknow.top/mj/task/{id}/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "1712158011464906",
"action": "IMAGINE",
"prompt": "Cat",
"promptEn": "Cat",
"description": "Submit success",
"submitTime": 1735689600000,
"startTime": 1735689610000,
"finishTime": 0,
"imageUrl": "",
"videoUrl": "",
"status": "IN_PROGRESS",
"progress": "65%",
"failReason": "",
"buttons": null,
"state": "",
"imageUrls": []
}
{
"id": "1712158011464906",
"action": "IMAGINE",
"prompt": "Cat",
"promptEn": "Cat",
"description": "success",
"submitTime": 1735689600000,
"startTime": 1735689610000,
"finishTime": 1735689720000,
"imageUrl": "https://.../image.png",
"videoUrl": "",
"status": "SUCCESS",
"progress": "100%",
"failReason": "",
"buttons": [
{
"customId": "MJ::JOB::upsample::1::xxx",
"emoji": "",
"label": "U1",
"type": 2,
"style": 2
}
],
"state": "",
"imageUrls": [
{
"url": "https://.../image.png"
}
]
}
Midjourney
Midjourney 任务查询
查询 Midjourney 单任务、批量任务和任务图片 seed。
GET
https://www.geeknow.top
/
mj
/
task
/
{id}
/
fetch
Midjourney 任务查询
curl --request GET \
--url https://www.geeknow.top/mj/task/{id}/fetch \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.geeknow.top/mj/task/{id}/fetch"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.geeknow.top/mj/task/{id}/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.geeknow.top/mj/task/{id}/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.geeknow.top/mj/task/{id}/fetch"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.geeknow.top/mj/task/{id}/fetch")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.geeknow.top/mj/task/{id}/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "1712158011464906",
"action": "IMAGINE",
"prompt": "Cat",
"promptEn": "Cat",
"description": "Submit success",
"submitTime": 1735689600000,
"startTime": 1735689610000,
"finishTime": 0,
"imageUrl": "",
"videoUrl": "",
"status": "IN_PROGRESS",
"progress": "65%",
"failReason": "",
"buttons": null,
"state": "",
"imageUrls": []
}
{
"id": "1712158011464906",
"action": "IMAGINE",
"prompt": "Cat",
"promptEn": "Cat",
"description": "success",
"submitTime": 1735689600000,
"startTime": 1735689610000,
"finishTime": 1735689720000,
"imageUrl": "https://.../image.png",
"videoUrl": "",
"status": "SUCCESS",
"progress": "100%",
"failReason": "",
"buttons": [
{
"customId": "MJ::JOB::upsample::1::xxx",
"emoji": "",
"label": "U1",
"type": 2,
"style": 2
}
],
"state": "",
"imageUrls": [
{
"url": "https://.../image.png"
}
]
}
Midjourney 任务查询
Midjourney 查询接口用于轮询任务进度、获取最终图片信息,以及读取任务按钮和 seed。- 单任务查询走
GET /mj/task/{id}/fetch - 批量查询走
POST /mj/task/list-by-condition - 图片 seed 查询走
GET /mj/task/{id}/image-seed
查询单个任务
GET /mj/task/{id}/fetch
curl https://www.geeknow.top/mj/task/1712158011464906/fetch \
-H "Authorization: Bearer YOUR_API_KEY"
响应字段
任务 ID。
任务动作,常见值包括
IMAGINE、UPSCALE、VARIATION、ZOOM、PAN、DESCRIBE、BLEND、SHORTEN、SWAP_FACE。原始提示词。
英文提示词。
任务描述。
提交时间。
开始执行时间。
结束时间。
主图片地址。
视频地址。
任务状态,常见值为
NOT_START、SUBMITTED、MODAL、IN_PROGRESS、FAILURE、SUCCESS、CANCEL。任务进度,例如
0%、65%、100%。失败原因。
图片下方可继续触发的操作按钮数组。
自定义参数。
图片列表。
响应示例
{
"id": "1712158011464906",
"action": "IMAGINE",
"prompt": "Cat",
"promptEn": "Cat",
"description": "Submit success",
"submitTime": 1735689600000,
"startTime": 1735689610000,
"finishTime": 0,
"imageUrl": "",
"videoUrl": "",
"status": "IN_PROGRESS",
"progress": "65%",
"failReason": "",
"buttons": null,
"state": "",
"imageUrls": []
}
{
"id": "1712158011464906",
"action": "IMAGINE",
"prompt": "Cat",
"promptEn": "Cat",
"description": "success",
"submitTime": 1735689600000,
"startTime": 1735689610000,
"finishTime": 1735689720000,
"imageUrl": "https://.../image.png",
"videoUrl": "",
"status": "SUCCESS",
"progress": "100%",
"failReason": "",
"buttons": [
{
"customId": "MJ::JOB::upsample::1::xxx",
"emoji": "",
"label": "U1",
"type": 2,
"style": 2
}
],
"state": "",
"imageUrls": [
{
"url": "https://.../image.png"
}
]
}
批量查询任务
POST /mj/task/list-by-condition
{
"ids": [
"1712158011464906"
]
}
获取任务图片 seed
GET /mj/task/{id}/image-seed
{
"code": 1,
"description": "",
"result": "1234567890"
}
获取公开图片
GET /mj/image/{id}
curl -L https://www.geeknow.top/mj/image/1712158011464906 --output output.png
相关接口
⌘I