### Initialize Picsart TypeScript SDK Source: https://docs.picsart.io/llms.txt Get started with the Picsart TypeScript SDK by setting up the SDK and creating API instances. This example shows basic image manipulation using public URLs. ```typescript import picsart from "picsart-image-sdk"; const apiKey = "YOUR_API_KEY"; picsart.setApiKey(apiKey); const image = picsart.image.createImage( "https://a-us.com/img/sample.jpg" ); console.log(image.url); ``` -------------------------------- ### Install GIMP via Flatpak Source: https://docs.picsart.io/docs/apps-tools-gimp Install GIMP using Flatpak. Ensure Flatpak is installed on your system first. ```shell flatpak install flathub org.gimp.GIMP ``` -------------------------------- ### Examples of API Version URLs Source: https://docs.picsart.io/docs/creative-apis-versioning These examples show how API versions are indicated in URLs. The version is typically found as a suffix starting with 'v' or 'V' followed by a number. ```plaintext api.picsart.io/1.0/ // version 1 video-api.picsart.io/v1/ // version 1 video-api.picsart.io/v2/ // version 2 ``` -------------------------------- ### Complete HTML Setup for Picsart Editor Source: https://docs.picsart.io/docs/photo-video-editor-how-to-setup-for-the-basic-plan A full HTML file demonstrating the integration and setup of the Picsart editor, including initialization, configuration, and event handling. ```html [Your company name]
``` -------------------------------- ### Install Plugin Dependencies Source: https://docs.picsart.io/docs/apps-tools-sketch Install the necessary Node.js dependencies for the Picsart Sketch Plugin using npm. ```shell npm install ``` -------------------------------- ### Unsupported Media Type Example (415) Source: https://docs.picsart.io/docs/creative-apis-error-codes This example demonstrates how a POST request with an incorrect Content-type header can result in a 415 Unsupported Media Type error. Ensure the Content-type matches the API's expected format, typically application/json. ```bash curl https://api.picsart.io/tools/demo/upscale \ -X POST \ -H "Content-type:text/xml" \ -d `` ``` -------------------------------- ### Get AI Effect Names Source: https://docs.picsart.io/reference/image-generate-pattern Retrieves a list of all supported AI effects that can be applied to images. ```APIDOC ## GET /effects/ai ### Description Retrieves the list of supported AI effects. ### Method GET ### Endpoint /effects/ai ### Response #### Success Response (200) - **effects** (array of strings) - A list of available AI effect names. #### Response Example ```json { "effects": ["effect1", "effect2", "effect3"] } ``` ``` -------------------------------- ### Initialize Spring Boot Project Structure Source: https://docs.picsart.io/docs/how-to-integrate-creative-apis-into-a-spring-boot-application Create a new Gradle-based Spring Boot project and set up the basic directory structure. ```bash $ mkdir picsart-api-integration $ cd picsart-api-integration $ gradle wrapper --gradle-version 7.5 $ mkdir -p src/main/resources $ mkdir -p src/main/java/com/example/picsart/ ``` -------------------------------- ### Install and Initialize Picsart TypeScript SDK Source: https://docs.picsart.io/docs/creative-apis-typescript-sdk-getting-started Import the PicsartEnterprise class and create instances for image and GenAI APIs using your API key. Ensure you replace 'YOUR_API_KEY' with your actual key. ```typescript import PicsartEnterprise from "picsart-creative-apis-ts-sdk"; // Get an instance of image API const imageApi = PicsartEnterprise.createImageApi('YOUR_API_KEY'); // Get an instance of GenAI API const genaiApi = PicsartEnterprise.createGenAIApi('YOUR_API_KEY'); ``` -------------------------------- ### Generate Logo Source: https://docs.picsart.io/reference/genai-generate-logo Generates logos based on provided company information and descriptions. It supports various models and allows for guiding the generation with additional details or an example logo. ```APIDOC ## POST /logo ### Description Generate logos using company info, general description. You can add additional information to guide on the details you want to get on the logo. It is also possible to provide an example logo to generate similar logos. ### Method POST ### Endpoint /logo ### Request Body - **model** (string) - Optional - Specifies the AI model to use for generation. Available options include various Flux, Gemini, Hunyuan, Ideogram, and Imagen models. ### Response #### Success Response (202 Accepted) - **transaction_id** (string) - The identifier for the asynchronous generation process. #### Response Example { "transaction_id": "some-transaction-id" } ``` -------------------------------- ### Instantiate Picsart SDK and Handle Export in React Source: https://docs.picsart.io/docs/photo-video-editor-reactjs Initialize the Picsart SDK within a useEffect hook in your React component. This example demonstrates opening an image, handling the export event to get image data, and creating a download link. Remember to declare Picsart globally if using TypeScript. ```tsx import { useEffect } from 'react'; const PicsartEditorContainer = () => { useEffect(() => { const PicsartInstance = new Picsart({ apiKey: 'YOUR_API_KEY_GOES_HERE', // provided during the signup process customerId: 'CUSTOMER_ID_GOES_HERE', // provided during the signup process propertyId: 'YOUR_PROPERTY_ID_GOES_HERE', // provided during the signup process containerId: 'containerId', // should match the identifier of the container element title: 'Photo Print Designer' }); // adding new lines here to open and save const imageUrl = "https://cdn-cms-uploads.picsart.com/cms-uploads/05b3d2e9-1fd6-43f3-b342-b232638c5614.png"; PicsartInstance.open({ imageUrl }); PicsartInstance.onExport((output) => { if (output.data.imageData) { const blob = output.data.imageData; const link = document.createElement('a'); link.href = typeof blob === 'string' ? blob : URL.createObjectURL(blob); link.download = 'picsart-editor-result-image.png'; document.body.append(link); link.click(); link.remove(); } }); }, []); return (
); }; export default PicsartEditorContainer; declare global { interface Window { Picsart:any; } } ``` -------------------------------- ### Face Enhancement API Example Source: https://docs.picsart.io/llms.txt Demonstrates the usage of the Face Enhancement API. Ensure you have your API key configured. ```python from picsart_api.api import PicsartApi api = Picsart_api(api_key="YOUR_API_KEY") # Example usage of the Face Enhancement API response = api.face_enhance( image_url="https://example.com/your_image.jpg", output_format="png" ) # Process the response print(response.json()) ``` -------------------------------- ### Complete HTML Setup for Picsart Configurable Plan Source: https://docs.picsart.io/docs/photo-video-editor-how-to-setup-for-the-configurable-plan This HTML file demonstrates the full integration of the Picsart SDK for a configurable print editor. It includes styling, SDK initialization with custom properties, and event listeners for export. ```html [Your company name]
``` -------------------------------- ### GET /logo/inferences/{inference_id} Source: https://docs.picsart.io/reference/genai-generate-logo Get the results of your logo generation. Use the inference identifier from the Logo Generator. ```APIDOC ## GET /logo/inferences/{inference_id} ### Description Get the results of your logo generation. Use the inference identifier from the [Logo Generator](https://docs.picsart.io/reference/genai-generate-logo). ### Method GET ### Endpoint /logo/inferences/{inference_id} ### Parameters #### Path Parameters - **inference_id** (string) - Required - The inference identifier returned from the POST method [Logo Generator](https://docs.picsart.io/reference/genai-generate-logo). Example: "1116b57cb-1999-4bfd-8c42-c739a006a111" #### Query Parameters None ### Response #### Success Response (200) - **$ref** (string) - Reference to Text2ImageStatusResponse schema. #### Success Response (202) - **$ref** (string) - Reference to Text2ImageResponse schema. #### Error Responses - **400**: Bad Request - **401**: Unauthorized - **402**: Payment Required - **403**: Forbidden - **404**: Not Found - **405**: Method Not Allowed - **413**: Payload Too Large - **415**: Unsupported Media Type - **429**: Too Many Requests - **431**: Request Header Fields Too Large - **500**: Internal Server Error - **503**: Service Unavailable ``` -------------------------------- ### Load Picsart SDK and Initialize Editor Source: https://docs.picsart.io/docs/photo-video-editor-how-to-setup-for-the-basic-plan Load the Picsart SDK script and initialize the editor instance with essential configuration properties. ```html
``` -------------------------------- ### Get the Audio result Source: https://docs.picsart.io/llms.txt Use the video editing transaction ID to get the result audio file URL. ```APIDOC ## POST /video/getaudioresult ### Description Use the video editing transaction ID to get the result audio file URL. ### Method POST ### Endpoint /video/getaudioresult ### Parameters #### Request Body - **transaction_id** (string) - Required - The transaction ID from a previous video editing operation that produced audio. ``` -------------------------------- ### Get Credit Balance Source: https://docs.picsart.io/reference/genai-avatars-credits-balance Retrieves the current balance of credits associated with your API key. This is a GET request to the /balance endpoint. ```APIDOC ## GET /balance ### Description Check your balance of credits. ### Method GET ### Endpoint /balance ### Parameters #### Headers - **X-Picsart-API-Key** (string) - Required - Your API key for authentication. ### Response #### Success Response (200) - **balance** (integer) - The current number of credits available. #### Response Example ```json { "balance": 1000 } ``` #### Error Responses - **400**: Bad Request - **401**: Unauthorized - **403**: Forbidden - **404**: Not Found - **405**: Method Not Allowed - **413**: Payload Too Large - **415**: Unsupported Media Type - **429**: Too Many Requests - **431**: Request Header Fields Too Large - **500**: Internal Server Error - **503**: Service Unavailable ``` -------------------------------- ### Initialize Picsart SDK for Video Editing Source: https://docs.picsart.io/docs/photo-video-editor-video-editing-code-example This snippet shows how to initialize the Picsart SDK with video editing specific configurations. It sets up API keys, export formats, resolution, and available tools. ```html Video Example
``` -------------------------------- ### SRT Subtitle Example Source: https://docs.picsart.io/docs/subtitle-formats A basic example of the SubRip Subtitle (SRT) format, showing sequential numbering, timecodes, and plain text. ```plaintext 1 00:01:12,000 --> 00:01:15,000 Hello, welcome to our video! ``` -------------------------------- ### Initialize Picsart Editor with Customization Source: https://docs.picsart.io/docs/photo-video-editor-photo-editor-code-example This snippet shows how to initialize the Picsart SDK with various configuration options, including API key, container ID, export formats, branding, theme, and enabled features. It also demonstrates how to provide custom shapes and labels, and handle export events. ```html Photo Example
``` -------------------------------- ### VTT Subtitle Example Source: https://docs.picsart.io/docs/subtitle-formats An example of the WebVTT (VTT) format, which includes a WEBVTT header and supports more advanced web features compared to SRT. ```plaintext WEBVTT 00:01:12.000 --> 00:01:15.000 Hello, welcome to our video! ``` -------------------------------- ### Watermark Configuration Example Source: https://docs.picsart.io/docs/photo-video-editor-full-list-of-parameters Configure watermark settings for export. Specify the URL, opacity, scale, and whether to enable export and canvas watermarking. ```javascript "watermark":{ "url": "bla.png", "opacity": "1", // 0 to 1 "scale": 10, // what are the params and what is the starting size? "export": true, "canvas": false } ``` -------------------------------- ### GET /video/{id}/thumbnail Source: https://docs.picsart.io/reference/video-get-thumbnail Retrieves a thumbnail for a specific video. This endpoint allows you to get a preview image of a video by providing its unique identifier. ```APIDOC ## GET /video/{id}/thumbnail ### Description Retrieves a thumbnail for a specific video. This endpoint allows you to get a preview image of a video by providing its unique identifier. ### Method GET ### Endpoint /video/{id}/thumbnail ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the video. ### Response #### Success Response (200) - **thumbnail** (string) - The URL of the generated thumbnail image. #### Response Example { "thumbnail": "https://example.com/thumbnails/video_id.jpg" } ERROR HANDLING: - **404** Not Found: The video with the specified ID was not found. - **405** Method Not Allowed: Indicates that the HTTP method used is not supported for this endpoint. - **413** Request Entity Too Large: The request is too large, possibly due to an oversized video file if applicable to the thumbnail generation process. ``` -------------------------------- ### OpenAPI Definition for Text2Audio Get Result Source: https://docs.picsart.io/reference/genai-text2audio-getresult This JSON defines the OpenAPI specification for the Text2Audio GET endpoint, including parameters, responses, and security schemes. ```json { "openapi": "3.0.0", "info": { "version": "1.0", "title": "Picsart GenAI API", "description": "[Official technical documentation portal](https://docs.picsart.io/)\n[Developer Guidelines](https://picsart.io/terms)\n" }, "servers": [ { "url": "https://genai-api.picsart.io/v1", "description": "Production" } ], "paths": { "/audio/{inference_id}": { "get": { "summary": "Get the Audio Generation result", "operationId": "genai-text2audio-getresult", "description": "Use this method, along with inference id, to retrieve the generated speech or sound/music.\n", "parameters": [ { "in": "path", "name": "inference_id", "schema": { "type": "string" }, "required": true, "description": "The ID returned from the POST method.", "example": "1116b57cb-1999-4bfd-8c42-c739a006a111" } ], "tags": [ "Text2Audio" ], "responses": { "200": { "$ref": "#/components/responses/Text2VideoStatusResponse" }, "202": { "$ref": "#/components/responses/Text2ImageResponse" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "402": { "$ref": "#/components/responses/402" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "405": { "$ref": "#/components/responses/405" }, "413": { "$ref": "#/components/responses/413" }, "415": { "$ref": "#/components/responses/415" }, "429": { "$ref": "#/components/responses/429" }, "431": { "$ref": "#/components/responses/431" }, "500": { "$ref": "#/components/responses/500" }, "503": { "$ref": "#/components/responses/503" } } } } }, "security": [ { "apiKey": [] } ], "components": { "schemas": { "Error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "detail": { "type": "string" } }, "required": [ "detail" ] } }, "responses": { "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "headers": { "X-Picsart-Correlation-Id": { "schema": { "type": "string" }, "description": "The id which will help for troubleshooting request chain in the system." }, "X-Picsart-Ratelimit-Available": { "schema": { "type": "integer" }, "description": "The number of available calls within the timeframe. See the X-Picsart-Ratelimit-Reset-Time." }, "X-Picsart-Ratelimit-Limit": { "schema": { "type": "integer" }, "description": "The total number of requests that can be done within the timeframe. See the X-Picsart-Ratelimit-Reset-Time." }, "X-Picsart-Ratelimit-Reset-Time": { "schema": { "type": "integer" }, "description": "The time when the used request count resets and the number of available calls gets equal to the total number." }, "X-Picsart-Credit-Available": { "schema": { "type": "integer" }, "description": "The remaining number of the credits on the balance." } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } ``` -------------------------------- ### Configure MCP Server Source: https://docs.picsart.io/docs/build-integrations-cursor-windsurf Add Picsart to your MCP configuration file. Replace "" with your actual Picsart API key. ```json { "mcpServers": { "picsart": { "type": "http", "url": "wss://mcp.picsart.com", "headers": { "x-picsart-api-key": "" } } } } ``` -------------------------------- ### Remove.bg JSON Response Example Source: https://docs.picsart.io/docs/creative-apis-migration-removebg This is an example of a JSON response from Remove.bg, which may contain a base64 encoded image string and foreground positioning data. ```json { "data": { "result_b64": "iVBORw0KGgoAAAANSUhEUgAAAIsAAACFC...", "foreground_top": 0, "foreground_left": 0, "foreground_width": 100, "foreground_height": 100 } } ``` -------------------------------- ### Navigate to Plugin Directory Source: https://docs.picsart.io/docs/apps-tools-sketch Change your current directory to the cloned plugin folder in your terminal. ```shell cd picsart-sketch-plugin ``` -------------------------------- ### Branding Configuration Example Source: https://docs.picsart.io/docs/photo-video-editor-full-list-of-parameters This snippet shows how to structure the 'branding' object to customize the editor's UI colors and fonts. It includes accent, hover, main, text, and background colors, along with font definitions. ```javascript "branding": { "accents": '#EEC443', "hover: '#EED792', "main": '#1F3B5E', "texts": '#FFFFFF', "background": '#0A1E37’, "fonts": [ { fontStyle: 'normal', fontWeight: 400, fontDisplay: 'swap', src: 'url(“https://fonts.gstatic.com/s/barriecito/v17/WWXXlj-CbBOSLY2QTuY_Gd0oYibNwMR2ng.woff2”) format(“woff2”)', unicodeRange: 'U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB', }, { fontStyle: 'normal', fontWeight: 400, fontDisplay: 'swap', src: 'url(“https://fonts.gstatic.com/s/barriecito/v17/WWXXlj-CbBOSLY2QTuY_GdwoYibNwMR2ng.woff2”) format(“woff2”)', unicodeRange: 'U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF', }, { fontStyle: 'normal', fontWeight: 400, fontDisplay: 'swap', src: 'url(“https://fonts.gstatic.com/s/barriecito/v17/WWXXlj-CbBOSLY2QTuY_GdIoYibNwMQ.woff2”) format(“woff2”)', unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD', }, ] } ``` -------------------------------- ### Get Transcribe Audio Result API Definition Source: https://docs.picsart.io/reference/video-transcribe-audio-getresult-1 This is the OpenAPI definition for the GET request to retrieve the audio transcription result. It specifies the endpoint, parameters, and possible responses. ```json { "openapi": "3.0.0", "info": { "version": "1.0", "title": "Picsart Programmable Video APIs", "description": "[Official technical documentation portal](https://docs.picsart.io/)\n[Developer Guidelines](https://picsart.io/terms)\n" }, "servers": [ { "url": "https://video-api.picsart.io/v1", "description": "Production" } ], "paths": { "/audio/transcribe/{transaction_id}": { "get": { "summary": "Get the Transcribe Audio result", "operationId": "video-transcribe-audio-getresult", "description": "Use this method, along with transaction_id, to retrieve the audio transcription.\n", "parameters": [ { "in": "path", "name": "transaction_id", "schema": { "type": "string" }, "required": true, "description": "The Transaction ID returned from the [Transcribe Audio](https://docs.picsart.io/reference/video-transcribe-audio)." } ], "tags": [ "Transcriptions" ], "responses": { "200": { "$ref": "#/components/responses/200" }, "202": { "$ref": "#/components/responses/202" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "402": { "$ref": "#/components/responses/402" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "405": { "$ref": "#/components/responses/405" }, "413": { "$ref": "#/components/responses/413" }, "415": { "$ref": "#/components/responses/415" }, "422": { "$ref": "#/components/responses/422" }, "429": { "$ref": "#/components/responses/429" }, "431": { "$ref": "#/components/responses/431" }, "500": { "$ref": "#/components/responses/500" }, "503": { "$ref": "#/components/responses/503" } } } } }, "security": [ { "apiKey": [] } ], "components": { "schemas": { "Error": { "type": "object", "properties": { "message": { "type": "string" }, "detail": { "type": "string" } }, "required": [ "detail" ] }, "401_Error": { "type": "object", "properties": { "code": { "type": "integer", "example": 401 }, "message": { "type": "string", "example": "Unauthorized" }, "detail": { "type": "string" } }, "required": [ "detail" ] } }, "responses": { "200": { "description": "Success.", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "url": { "type": "string", "format": "uri", "nullable": false } } }, "status": { "type": "string", "enum": [ "success", "error", "processing", "queued" ], "nullable": false } } }, "example": { "status": "success", "data": { "id": "75c68cf6-9881-46a5-a3e8-6907640901eb", "url": "https://cdn.picsart.io/d04d0fd0-192f-4532-bd9a-aa63a728e39c.mp4" } } } }, "headers": { "X-Picsart-Correlation-Id": { "schema": { "type": "string" }, "description": "The id which will help for troubleshooting request chain in the system." }, "X-Picsart-Ratelimit-Available": { "schema": { ```