CodingMantra LogoCodingMantra
GalleryProductsPortfolioServicesGamesPricingContact
  1. Home
  2. API Documentation
  3. Image Tools
  4. Product Photography

Product Photography API

Generate studio-quality product photos by placing your product in custom scenes.

GET
/api/image/product-photography-prompts

Retrieve a list of all available pre-defined scene instructions for the Product Photography endpoint.

Example Request

curl -X GET 'https://codingmantra.com/api/image/product-photography-prompts'

Example Response

{
  "data": [
    {
      "id": "minimalist-white",
      "title": "E-commerce White Background",
      "categoryId": "studio-minimalist",
      "categoryTitle": "Studio & Minimalist",
      "demoImageUrl": "https://..."
    },
    // ... more prompts
  ]
}

POST
/api/image/product-photography

Generate a professional product photograph by placing your product in a custom scene.

Request Body

Note: Either `promptId` or `scenePrompt` is required.

FieldTypeDescription
productImagesArray of ObjectsRequired. An array of product image objects. Each object must have either a `dataUrl` (a Base64 data URI) or a `url` (a public https URL pointing to a JPEG, PNG, or WEBP image). Also supports an optional `label` string and an optional `prompt` string.
promptIdstringOptional. The ID of a pre-defined scene instruction. Use this for curated scenes. Get available IDs from the `/api/image/product-photography-prompts` endpoint.
scenePromptstringOptional. A text description of the desired background or scene. Can be used alone or as an addition to a `promptId`.
logoImagestringOptional. A data URI (Base64) or a public https URL of a logo to place on the image.
logoPlacementstringOptional. Instructions for logo placement (e.g., 'top-left', 'center').
logoSizenumberOptional. A numeric value (0.1 to 0.5) representing the logo size as a percentage of the image.
referenceImagestringOptional. A data URI (Base64) or URL of a reference image to guide the style and concept.
overlayTextstringOptional. Short text to overlay prominently on the image.
marketingTextstringOptional. More detailed marketing text or slogan.
aspectRatiostringOptional. The desired output aspect ratio. Can be `'1:1'` (Square), `'16:9'` (Landscape), or `'9:16'` (Portrait). Default: `'1:1'`.
outputResultstringOptional. The desired output format. Can be `'base64'` (default) or `'url'` to receive hosted image URLs.

Example Request (with promptId)

curl -X POST 'https://codingmantra.com/api/image/product-photography' \
     -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer YOUR_API_KEY' \
     -d '{
          "productImages": [
            { "url": "https://example.com/my-product.png", "label": "bottle" }
          ],
          "promptId": "rustic-wood-table",
          "scenePrompt": "with grapes and cheese",
          "logoImage": "https://example.com/my-logo.png",
          "logoPlacement": "bottom-right",
          "logoSize": 0.15,
          "aspectRatio": "16:9",
          "outputResult": "url"
        }'

Example Response (outputResult: 'url')

{
  "data": {
    "imageUrl": "https://storage.googleapis.com/...",
    "thumbnailUrl": "https://storage.googleapis.com/..."
  }
}

Example Response (outputResult: 'base64')

{
  "data": {
    "photoDataUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
  }
}

On This Page

GET PromptsPOST Generate ImageFAQ

Frequently Asked Questions

CodingMantra LogoCodingMantra

Providing business solutions for small and medium-sized businesses and helping them to grow.

WhatsApp ChannelX / TwitterLinkedInInstagramFacebookGitHubYouTube

Company

  • About Us
  • Services
  • Products
  • Portfolio
  • Pricing
  • Blog
  • API Docs
  • Contact Us

Top Tools

  • All Tools
  • Image Gallery
  • Image Tools
  • Digital Marketing
  • Financial Tools
  • Games
  • SEO Tools

Legal

  • Privacy Policy
  • Terms & Conditions
  • Return Policy
  • Deals
  • Sitemap

© 2026 CodingMantra. All Rights Reserved.