Get result

Python Example

# get_results.py
import os
import requests

BASE = "https://api.mangaka.app/v1/api"
API_KEY = os.getenv("MANGAKA_API_KEY", "YOUR_API_KEY")
HEADERS = {"x-api-key": API_KEY}

STORY_ID = "STORY_ID"
CHAPTER_ID = 3149  # Example: 3149

def get_results(story_id: str, chapter_id: int):
    """
    Retrieve the final generated pages and their associated images.
    Endpoint: GET /v1/api/stories/{story_id}/chapters/{chapter_id}/pages
    """
    url = f"{BASE}/stories/{story_id}/chapters/{chapter_id}/pages"
    response = requests.get(url, headers=HEADERS, timeout=60)
    response.raise_for_status()
    data = response.json()
    print(data)
    # Response structure:
    # data['data']['pages'] → list of pages with:
    #   page_id, prompt, image (signed URL), status, index
    # Use 'image' URLs to preview or download generated artwork.

if __name__ == "__main__":
    get_results(STORY_ID, CHAPTER_ID)

Last updated