# Midjourney Bot (`imageaibot/midjourney-bot`) Actor

This Actor integrates Discord Midjourney-related APIs, including text-to-image, image operations (such as upscaling or extending an already generated image), image blending, image-to-text, task query, and more .website: [Midjourney中国官网](https://mj.bandeyu.com)

- **URL**: https://apify.com/imageaibot/midjourney-bot.md
- **Developed by:** [ImageAI Bot](https://apify.com/imageaibot) (community)
- **Categories:** AI, E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 313 total users, 11 monthly users, 99.9% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$60.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## MidjourneyBot - API Integration & Documentation

### Project Overview

This Actor integrates Discord Midjourney-related APIs, including text-to-image, image operations (such as upscaling or extending an already generated image), image blending, image-to-text, task query, and more. You do not need to have your own Midjourney account this can serve as a scaffold for automated calls, batch testing, and data aggregation.

### Supported Features

1. imagine: Text-to-image. Supports all Midjourney parameters, such as --ar, --sref, --iw, etc.
2. action: Perform secondary operations on generated or upscaled images, such as further extension, lossless upscaling, etc.
3. blend: Blend up to 5 images.
4. describe: Generate prompts from images.
5. getTask: Query a single task.
6. listTask: Query multiple tasks.

### Other image API

1. [Image 2 API](https://apify.com/imageaibot/image-2-api)
2. [NanoBanana API](https://apify.com/imageaibot/nanobanana-api)
3. [Midjourney API](https://apify.com/imageaibot/midjourney-bot)

***

### Usage Instructions

#### Select the Feature You Want to Use

Available values: imagine | action | blend | describe | getTask | listTask

#### Input Different Body Json According to the Feature, Then Click Run

##### 1. imagine

- Example Body Json:
  ```json
  {
    "notifyHook": "https://abc.com/webhook/",
    "prompt": "Cat --ar 9:16"
  }
  ```
- Example Response:
  ```json
  {
    "code": 1,
    "description": "Submit success",
    "result": "123"
  }
  ```

##### 2. Image Operation (action)

- Example Body Json:
  ```json
  {
    "notifyHook": "",
    "customId": "MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011",
    "taskId": "123"
  }
  ```
- Example Response:
  ```json
  {
    "code": 1,
    "description": "Submit success",
    "result": "234"
  }
  ```

##### 3. Image Blending (blend)

- Example Body Json:
  ```json
  {
    "notifyHook": "https://abc.com/webhook/",
    "imgUrlArray": [
      "https://reserve-clear-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/clear-20250605/f7eaa99498eb7c7aca0a7475a6137b3e.png",
      "https://reserve-clear-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/clear-20250605/7ead651f61bb7bd186adeb61f5699657.png"
    ],
    "aspectRatio": "3:4"
  }
  ```
- Example Response:
  ```json
  {
    "code": 1,
    "description": "Submit success",
    "result": "234"
  }
  ```

##### 4. Image-to-Text (describe)

- Example Body Json:
  ```json
  {
    "imgUrl": "https://reserve-clear-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/clear-20250605/f7eaa99498eb7c7aca0a7475a6137b3e.png",
    "notifyHook": "https://abc.com/webhook/"
  }
  ```
- Example Response:
  ```json
  {
    "code": 1,
    "description": "Submit success",
    "result": "234"
  }
  ```

##### 5. Query Single Task (getTask)

- Example Body Json:
  ```json
  {
    "id": "123"
  }
  ```
- Example Response:
  ```json
  {
    "id": "123",
    "action": "DESCRIBE",
    "status": "SUCCESS",
    "cost": 30,
    "promptEn": "1️⃣ White haired anime boy...",
    "description": "Submit success",
    "submitTime": 1712205491372,
    "startTime": 1712205494313,
    "finishTime": 1712205499534,
    "progress": "100%",
    "imageUrl": "https://xxx.jpg",
    "cnTempImgUrl": "http://abc.com/xxx/xxx/e6278fb4db0a44c79b3f80d0d977350.png",
    "buttons": [
      {
        "customId": "MJ::Job::PicReader::1",
        "emoji": "1️⃣"
      },
      {
        "customId": "FL::Job::PicReader::2",
        "emoji": "2️⃣"
      }
    ]
  }
  ```

##### 6. Query Multiple Tasks (listTask)

- Example Body Json:
  ```json
  {
    "ids": [
      "123",
      "345"
    ]
  }
  ```
- Example Response:
  ```json
  [
    {
      "id": 123,
      "action": "FACESTYLE",
      "status": "SUCCESS",
      "cost": 40,
      "description": "Submit success",
      "progress": "100%",
      "imageUrl": "http://abc.com/1.png",
      "notifyHook": "http://abc.com/webhook"
    },
    {
      "id": 456,
      "action": "FACESTYLE",
      "status": "SUCCESS",
      "cost": 40,
      "description": "Submit success",
      "progress": "100%",
      "imageUrl": "http://abc.com/2.png",
      "notifyHook": "http://abc.com/webhook"
    }
  ]
  ```

***

### Be Sure to Configure notifyHook for Return Values

The method for receiving and parsing the return value is as follows. For example, in PHP, it only takes 2 lines of code. You can use ChatGPT to convert it into your own language.

```php
<?php
$re = file_get_contents("php://input");
$json = json_decode($re);
print_r($json);
?>
```

### Testing Method

1. In the "Source" Tab, select the relevant Action in the Input section.
2. Copy the Body Json for the corresponding feature from this document and paste it in.
3. Click "Start" to begin.

***

### Security Notes

- Please be sure to set notifyHook; you will be notified automatically when image generation succeeds.
- getTask and listTask are only for querying if there are no generation results after 120 seconds.
- This program does not provide any guarantee regarding the copyright of the generated images.

***

### Price Description

If you have a large usage, you can choose a more suitable solution. Please contact 51bobo \[at] gmail.com

***

If you have any questions, please contact: 51bobo \[at] gmail.com
[Nano Banana官网](https://zh-nanobanana.com/)

# Actor input Schema

## `action` (type: `string`):

Select Your API Action

## `bodyJson` (type: `string`):

Please refer to the content in the README Tab above

## Actor input object example

```json
{
  "action": "imagine",
  "bodyJson": "{  \"notifyHook\": \"https://abc.com/webhook/\",  \"prompt\": \"Cat --ar 9:16\"}"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("imageaibot/midjourney-bot").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("imageaibot/midjourney-bot").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call imageaibot/midjourney-bot --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,imageaibot/midjourney-bot"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/nGWq0v4RSnO863frd/builds/vT7EgkJCX7UYGToWP/openapi.json
