API Documentation
Request

To send image url:

        curl --location --request POST 'https://www.postify.ai/api' \
        --form 'api_key="YOUR_API_KEY"' \
        --form 'image_context="YOUR_INPUT_TEXT"' \
        --form 'story_type="YOUR_STORY_TYPE"' \
        --form 'image_url="YOUR_IMAGE_URL"' 
        

To send local image:

        curl --location --request POST 'https://www.postify.ai/api' \
        --form 'api_key="YOUR_API_KEY"' \
        --form 'image_context="YOUR_INPUT_TEXT"' \
        --form 'story_type="YOUR_STORY_TYPE"' \
        --form 'blob_image="True"' \
        --form 'raw_image=@"YOUR_IMAGE_PATH"'
        

To send image url:

        import requests
        
        url = "https://www.postify.ai/api"
        
        payload = {
            "api_key": "YOUR_API_KEY", # from profile page
            "image_context": "YOUR_INPUT_TEXT", # e.g. I am on vacation with my family.
            "story_type": 'YOUR_STORY_TYPE', # from below table
            "image_url": 'YOUR_IMAGE_URL
        }
        response = requests.post(url, data=payload)
        

To send local image:

        import requests
        
        url = "https://www.postify.ai/api"
        payload = {
            "api_key": "YOUR_API_KEY", # from profile page
            "image_context": "YOUR_INPUT_TEXT", # e.g. I am on vacation with my family.
            "story_type": 'YOUR_STORY_TYPE', # from below table
            "image_url": 'YOUR_IMAGE_URL', 
            "blob_image": True
        }
        
        files = {'raw_image': open('YOUR_IMAGE_PATH', 'rb')}
        
        response = requests.post(url, files=files, data=payload)
        

To send image url:

        Unirest.setTimeouts(0, 0);
        HttpResponse <String> response = Unirest.post("https://www.postify.ai/api")
            .field("api_key", "YOUR_API_KEY")
            .field("image_context", "YOUR_INPUT_TEXT")
            .field("story_type", "YOUR_STORY_TYPE")
            .field("image_url", "YOUR_IMAGE_URL")
            .asString();
        

To send local image:

        Unirest.setTimeouts(0, 0);
        HttpResponse <String> response = Unirest.post("https://www.postify.ai/api")
            .field("api_key", "YOUR_API_KEY")
            .field("image_context", "YOUR_INPUT_TEXT")
            .field("story_type", "YOUR_STORY_TYPE")
            .field("image_url", "YOUR_IMAGE_URL")
            .field("blob_image", "True")
            .field("file", new File("YOUR_IMAGE_PATH"))
            .asString();
        

To send image url:

        var form = new FormData();
        form.append("api_key", "YOUR_API_KEY");
        form.append("image_context", "YOUR_INPUT_TEXT");
        form.append("story_type", "YOUR_STORY_TYPE");
        form.append("image_url", "YOUR_IMAGE_URL");
        
        var settings = {
            "url": "https://www.postify.ai/api",
            "method": "POST",
            "timeout": 0,
            "processData": false,
            "mimeType": "multipart/form-data",
            "contentType": false,
            "data": form
        };
        
        $.ajax(settings).done(function (response) {
            console.log(response);
        });
                                            

To send local image:

        var form = new FormData();
        form.append("api_key", "YOUR_API_KEY");
        form.append("image_context", "YOUR_INPUT_TEXT");
        form.append("story_type", "YOUR_STORY_TYPE");
        form.append("image_url", "YOUR_IMAGE_URL");
        form.append("blob_image", "True");
        form.append("raw_image", fileInput.files[0], "YOUR_IMAGE_PATH");
        
        var settings = {
            "url": "https://www.postify.ai/api",
            "method": "POST",
            "timeout": 0,
            "processData": false,
            "mimeType": "multipart/form-data",
            "contentType": false,
            "data": form
        };
        
        $.ajax(settings).done(function (response) {
            console.log(response);
        });
                                            

To send image url:

        var request = require('request');
        var fs = require('fs');
        var options = {
            'method': 'GET',
            'url': 'https://www.postify.ai/api',
            'headers': {
            },
            formData: {
            'api_key': 'YOUR_API_KEY',
            'image_context': 'YOUR_INPUT_TEXT',
            'story_type': 'YOUR_STORY_TYPE',
            'image_url': 'YOUR_IMAGE_URL'
            }
            }
        };
        request(options, function (error, response) {
            if (error) throw new Error(error);
            console.log(response.body);
        });
                                            

To send local image:

        var request = require('request');
        var fs = require('fs');
        var options = {
            'method': 'GET',
            'url': 'https://www.postify.ai/api',
            'headers': {
            },
            formData: {
            'api_key': 'YOUR_API_KEY',
            'image_context': 'YOUR_INPUT_TEXT',
            'story_type': 'YOUR_STORY_TYPE',
            'image_url': 'YOUR_IMAGE_URL',
            'blob_image': 'True',
            'file': {
                'value': fs.createReadStream('YOUR_IMAGE_PATH'),
                'options': {
                'filename': 'filename'
                'contentType': null
                }
            }
            }
        };
        request(options, function (error, response) {
            if (error) throw new Error(error);
            console.log(response.body);
        });
        
                                            

To send image url:

        <?php
        require_once 'HTTP/Request2.php';
        $request = new HTTP_Request2();
        $request->setUrl('https://www.postify.ai/api');
        $request->setMethod(HTTP_Request2::METHOD_GET);
        $request->setConfig(array(
            'follow_redirects' => TRUE
        ));
        $request->addPostParameter(array(
            'api_key' => 'YOUR_API_KEY',
            'image_context' => 'YOUR_INPUT_TEXT',
            'story_type' => 'YOUR_STORY_TYPE',
            'image_url' => 'YOUR_IMAGE_URL'
        ));
        
        try {
            $response = $request->send();
            if ($response->getStatus() == 200) {
            echo $response->getBody();
            }
            else {
            echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
            $response->getReasonPhrase();
            }
        }
        catch(HTTP_Request2_Exception $e) {
            echo 'Error: ' . $e->getMessage();
        }
                                            

To send local image:

        <?php
        require_once 'HTTP/Request2.php';
        $request = new HTTP_Request2();
        $request->setUrl('https://www.postify.ai/api');
        $request->setMethod(HTTP_Request2::METHOD_GET);
        $request->setConfig(array(
            'follow_redirects' => TRUE
        ));
        $request->addPostParameter(array(
            'api_key' => 'YOUR_API_KEY',
            'image_context' => 'YOUR_INPUT_TEXT',
            'story_type' => 'YOUR_STORY_TYPE',
            'image_url' => 'YOUR_IMAGE_URL',
            'blob_image' => 'True'
        ));
        $request->addUpload('file', 'YOUR_IMAGE_PATH', 'file', '<Content-Type Header>');
        try {
            $response = $request->send();
            if ($response->getStatus() == 200) {
            echo $response->getBody();
            }
            else {
            echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
            $response->getReasonPhrase();
            }
        }
        catch(HTTP_Request2_Exception $e) {
            echo 'Error: ' . $e->getMessage();
        }
        
                                            

Response

        {
            "status": "success",
            "generated_story": "GENERATED_STORY,
            "remaining_generation": "YOUR_REMAINING_GENERATIONS"
        }
    

Error response

        {
            "status": "fail",
            "error": "ERROR_TYPE",
            "message": "ERROR_MESSAGE"
        }
    

Parameters
This will genrate from your profile page. And it's datatype must be a string. Get your API Key
You can provide more context/reference about the image so that our AI can write accordingly.
You can provide a story type from below listed story key.

Story type and description

Story type Story key ( For URL) Description
LinkedIn motivational story linkedin-motivational-story This will generate a motivational story based on Image uploaded by user which inspires and encourages individuals to strive for their goals, overcome obstacles, and achieve success despite adversity.
LinkedIn general post linkedin-general-post This will generate a LinkedIn post related to Image uploaded by user, which allows users to share their thoughts, ideas, and insights with their professional network on the platform.
Instagram short caption instagram-short-caption This will generate a short description of Image for Instagram uploaded by user to express context, share their thoughts or call to action.
Instagram long story instagram-long-story This will generate a Slighter long description of Image for Instagram which includes more in-depth information, tell a story, or give a behind the scenes look at a project or event.
Facebook short caption facebook-short-caption This will generate a short description of Image for FaceBook uploaded by user to express context, share their thoughts or call to action.
Facebook long story facebook-long-story This will generate a Slighter long description of Image for FaceBook which includes more in-depth information, tell a story, or give a behind the scenes look at a project or event.
Provide a server url in this key. And If you want to use this field blob_image must be false.
This will be True or False. If you set a True, API will accept a raw_image insted of image_url. And If you set False, API will accept a image_url instad of raw_image.
This will accept a loacl image from your system. In this filed provide a relative path of your image and blob_image must be 'True'.
Error code and description
Error Description
api_key There is no API key in the request JSON. ( You can get your API key here. )
image_context There is no Image context in the request JSON.
story_type There is no story_type in the request JSON or Invalid story type ( Select story type from table)
image_url There is no image url in the request JSON.
raw_image You have set blob_image True and there is no image in the request JSON.
no-user Invalid API key ( You can get your API key here. )
free-trial-expired Your free trial is expired.
daily-limit-reached Your API calls for today are over.
long text image_contex should be less than 100 charcters.
3-words image_contex should be containing minimum 3 words.
30-words image_contex should not be containing more than 30 words.
valid_image image should be from (jpg, png or jpeg)
invalid-url Provide valid image URL
error_in_api Server is not responding. Try again later.