Generating multiple Instagram captions programmatically is pretty simple. Just give the name of the product that you want to promote and your audience as input like the following:

Product: q10 energy face cream

Audience: Mid-aged people

If you are using TextCortex python library, you can generate Instagram captions with 3 lines of code:

from textcortex import TextCortex

# Create the hemingwai object and enter your API Key
hemingwai = TextCortex(api_key='YOUR_API_KEY')

instagram_captions = hemingwai.generate_instagram_caption(product='q10 Energy face cream',
                                                         audience='Mid aged people',
                                                         source_language='en', character_count=200,
                                                         creativity=0.8, n_gen=2)                                                          
for row in instagram_captions: print(row)

Here is how the post request looks like using Axios NodeJS library:

var axios = require('axios');
var data = JSON.stringify({ "prompt": "Q10 Energy Face Cream", "parameters": "mid aged people", "character_count": 200, "source_language": "en", "category": "Instagram Caption", "temperature": 0.7, "n_gen": 2, "api_key": "YOUR_API_KEY" }); var config = { method: 'post', url: '', headers: { 'Content-Type': 'application/json' }, data : data }; axios(config) .then(function(response) { console.log(JSON.stringify(; }) .catch(function (error) { console.log(error); });

Text generation variables:

As you can see, there are some parameters that you can use to fine-tune the generated content. Here is the list of those parameters and what they do:

  • prompt: Prompting is a way to instruct the Enterprise API to start writing on a specific subject
  • parameters: Used for setting the tone of the generated copy text. It can be basically anything but please keep it plausible. For the social media, captions use case your should definitely enter a certain type of target audience as parameter.
  • category: This defines which type of content needs to be generated.
  • creativity: Floating number between 0-1. 0 being the lowest creativity and 1 being the highest. Default is 0.7
  • character_length: Integer which defines the maximum amount of characters that can be produced.
  • source_language: Language code of the source language of the written prompt. for example 'en' for English and 'de' for German. We support 72 languages. If you don't know the language code you can also use 'auto' for this field our system will recognize the language of the instructed prompt and follow through with it in its generation.