Whether you are a software company who wants to adopt a true value add for their end users or have a massive need for 100.000s of content creations.
The Hemingwai Enterprise API is here to help.
Generating content using the TextCortex Enterprise Text Generation API is as easy as following these 4 steps:
To shorten your development and integration cycle, we have published packages you can install wit the following commands:
pip install textcortex
Javascript Package:
npm i textcortex-hemingwai-js
In order to access the API, you need an authentication key. You need to send this key whenever you are sending a request to our servers. After the signup, you can find your token under API menu.
The authentication key looks like this:
API KEY: "gAAAAABgu6ycSzxAWqIeoR3y1yZ5EDrPkCEU6c6-0UNoOTf5CvwhSGOxln1g66BuOjckRuetjZhKYPKgUxWk_gsEhxbzS-yveg=="
There are different kinds of texts that you can generate using TextCortex AI. No matter if on our frontend products or as API the functionalities are the same.
Here is a list of categories you can use:
Auto Complete: Expands, continues and completes the instructed prompt
Blog Body: Generates blog articles on an instructed blog title and keywords.
Ads: Generates ads based on the product that you are selling. This model is instructed with a product and a target segment for generating texts.
Instagram Caption: Generates Instagram captions to promote a product from a perspective of a user.
Email Body: Generates email bodies. This model takes an email subject and a target segment for generating the main body text.
Email Subject: Generates email subjects. This model takes the keywords as an input and then generates an email subject.
Paraphrase: Paraphrases an instructed sentence and returns multiple variations of it
For example; to generate an email body you should send the Email Body as a category inside the post request JSON.
Post Request:
curl --location --request POST 'https://api.textcortex.com/hemingwai/generate_text' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "Summer Sale Newsletter",
"parameters": "Young People",
"character_count": 500,
"source_language": "en",
"category": "Email Body",
"temperature": 0.7,
"n_gen": 2,
"api_key":"YOUR_API_KEY"
}'
Response:
{
"status": "success",
"ai_results": [
{
"generated_text": "\n\nHey!\n\nWe're happy to announce our annual Summer Sale! We have discounts on all our products for the entire month of July.\n\nDon't miss out on these amazing deals!\n\nSincerely,\n\nYour Friends at the Store",
"rank": 0.901,
"text_length": 202,
"word_frequency": [],
"word_count": 35
}
],
"error": 200
}
Generating text content is as easy as making a POST request in your terminal to the Enterprise Text Generation API to this URL:
https://api.textcortex.com/hemingwai/generate_text
In each request, you need to send your auth token inside the JSON.
An example POST request would look like this:
curl --location --request POST 'https://api.textcortex.com/hemingwai/generate_text' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "How Rocket Jetpacks Work?",
"parameters": "",
"character_count": 500,
"source_language": "en",
"category": "Blog Body",
"temperature": 0.7,
"n_gen": 2,
"api_key":"YOUR_API_KEY"
}'
One python package to rule all the text content challenges
Generating content right inside your python project just takes 3 lines of code. To make things as easy as possible we have published a python package that you can install with the following command:
pip install textcortex
After installing the package, generating content gets very easy and pretty fast. There are different types of content that can be generated with TextCortex. These are:
Here is an example using the TextCortex python package to generate blog articles:
from textcortex import TextCortex
# Create the hemingwai object and enter your API Key
hemingwai = TextCortex(api_key='YOUR_API_KEY')
# Generate Blog articles using Hemingwai
blog = hemingwai.generate_blog(blog_title='Why SEO is important for your Business?',
blog_categories=['SEO', 'Business'],
source_language='en', character_count=400, creativity=0.7, n_gen=2)
print(blog)
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:
More usage examples can be found on the TextCortex text generation examples Github repo.
One NPM package to rule all the text content challenges.
Generating content right inside your project just takes 3 lines of code. To make things as easy as possible we have published a NPM-JS package that you can install with the following command:
npm i textcortex-hemingwai-js
After installing the package, generating content gets very easy and pretty fast. There are different types of content that can be generated with TextCortex. These are:
Here is an example using TextCortex JS package to generate blog articles:
const { TextCortex } = require("textcortex-hemingwai-js");
let hemingwai = new TextCortex(YOUR_API_KEY);
hemingwai
.generateBlog({
blog_title: "Why SEO is important for your Business?",
blog_categories: ["SEO", "Business"],
character_count: 300,
creativity: 0.5,
source_language: "en",
n_gen: 2,
})
.then((res) => {
console.log("res: ", res);
})
.catch((err) => {
console.log("err", err);
});
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:
More examples can be found under the JS package repo of textcortex on github.
Automate your ad creation with our text generation API
Generating unique and creative ad copies is pretty simple. Just instruct the prompt with product to promote and the target audience. For example_
Product to promote: 'Pink Geometric Bag'
Audience: Young women
If you are using TextCortex python library, you can generate blog articles 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')
ads = hemingwai.generate_ads(prompt='Pink Geometric Bag', parameters='Young Women',
source_language='en', character_count=200, creativity=0.7, n_gen=2)
for row in ads:
print(row)
Here is how the post request looks like using TextCortex JS library:
const { TextCortex } = require("textcortex-hemingwai-js");
let hemingwai = new TextCortex(YOUR_API_KEY);
hemingwai
.generateAds({
prompt: "Pink Geometric Bag",
parameters: "Young Women",
source_language: "en",
character_count: 200,
creativity: 0.7,
n_gen: 2,
})
.then((res) => {
console.log("res: ", res);
})
.catch((err) => {
console.log("err", err);
});
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:
Besides reading this guide on how to implement the API for blog writing we recommend you to have a look at our article about long-form and blog writing is hard that's why we take away 70% of your work with TextCortex.
Starting to generate unique and creative blog articles programmatically with our API is pretty simple. Just instruct the title of the blog post you want to generate together with the keywords that are important. For example:
Blog Title: 'Why SEO is important for your Business?'
Keywords: 'SEO', 'Business'
If you are using TextCortex python library, you can generate blog articles 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')
blog = hemingwai.generate_blog(blog_title='Why SEO is important for your Business?', blog_categories=['SEO', 'Business'],
source_language='en', character_count=400, creativity=0.7, n_gen=2)
for row in product_description:
print(row)
Here is how the post request looks like using TextCortex JS library:
import { TextCortex } from "textcortex-hemingwai-js";
const hemingwai = new TextCortex(YOUR_API_KEY);
hemingwai
.generateBlog({
blog_title: "Why SEO is important for your Business?",
blog_categories: ["SEO", "Business"],
character_count: 300,
creativity: 0.5,
source_language: "en",
n_gen: 2,
})
.then((res) => {
console.log("res: ", res);
})
.catch((err) => {
console.log("err", err);
});
Here is how the post request looks like using Axios NodeJS library:
var axios = require('axios');
var data = JSON.stringify({
"prompt": "Why SEO is important for your Business?",
"parameters": "'SEO', 'Business'",
"character_count": 400,
"source_language": "en",
"category": "Blog Body",
"temperature": 0.7,
"n_gen": 5,
"api_key": "YOUR_API_KEY"
});
var config = {
method: 'post',
url: 'https://api.textcortex.com/hemingwai/generate_text',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
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:
As mentioned in the beginning of the article we recommend reading the long-form and blog writing is hard that's why we take away 70% of your work with TextCortex article.
1) Give clear instructions.
If you ever feel disappointed by the text our AI writers have written for you, ask yourself:
Often, you can do the following:
Learn more about how our AI writers think: [LINK TO THE HELP CENTER]
2) Divide & Conquer
Like with so many big problems it helps to divide the task into smaller bite-sized pieces.
So instead of expecting a 2000 word article right from the start, you can start with smaller problems. Think about it an article is often consisting of an intro, the main part, and a conclusion.
Think about a content brief before starting to create.
For example, if you want want to write a blog about "how SEO helps businesses grow organically" and in the best you want around 2000 words this is quite big of a task. Divide & conquer the challenge and break it down.
Then bundle the responses together into a bigger piece of text content.
Besides reading this guide on how to implement the API for blog writing we recommend you to have a look at our article about how to use our TextCortex to create 1000s of selling descriptions for your Shopify, Amazon FBA or WooCommerce shop.
Starting to generate unique and creative product descriptions programmatically with our API is pretty simple. Just instruct the name of the product, add the fitting product category to it together with some features or the brand. For example:
Product Name: "Noise Cancelling Over Ear Headphone"
Brand: "JBL"
Features: ["Noise canceling", "Adjustable Fit"],
Category: ["electronics"],
If you are using TextCortex python library, you can generate product descriptions 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')
product_description = hemingwai.generate_product_descriptions(
product_title='Noise Cancelling Over Ear Headphone', product_category=['Electronics'], product_brand='JBL',
product_features=['Noise canceling', 'Adjustable Fit'],
source_language='en', character_count=300, creativity=0.6, n_gen=3)
for row in product_description:
print(row)
Here is how the post request looks like using TextCortex JS library:
import { TextCortex } from "textcortex-hemingwai-js";
const hemingwai = new TextCortex(YOUR_API_KEY);
hemingwai.generateProductDescriptions({
product_title: "Headphone",
product_brand: "JBL",
product_features: ["Noise canceling", "Adjustable Fit"],
product_category: ["Electronics"],
source_language: "en",
});
Here is how the post request looks like using Axios NodeJS library:
var axios = require('axios');
var data = JSON.stringify({
"prompt": "Headphones",
"parameters": "Category: ['Electronics'] Brand: JBL Features: ['color: red']",
"character_count": 200,
"source_language": "en",
"category": "Product Description",
"temperature": 0.7,
"n_gen": 2,
"api_key": "YOUR_API_KEY"
});
var config = {
method: 'post',
url: 'https://api.textcortex.com/hemingwai/generate_text',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Automate social media caption writing with our API.
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_caption = hemingwai.generate_instagram_caption(product='q10 Energy face cream',
audience='Middle aged people',
source_language='en', character_count=200,
creativity=0.8, n_gen=2)
for row in instagram_caption:
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": "middle 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: 'https://api.textcortex.com/hemingwai/generate_text',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
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:
Paraphrasing is as simple as a single POST request to TextCortex's API.
Sentence: Why search engine optimisation is important for your online business?
If you are using TextCortex python library, you can paraphrase given sentence 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')
paraphrase = hemingwai.paraphrase(
prompt="Why search engine optimisation is important for your online business?",
source_language='en', character_count=300, creativity=1, n_gen=5)
for row in paraphrase:
print(row)
Here is how the post request looks like using Axios NodeJS library:
var axios = require('axios');
var data = JSON.stringify({
"prompt": "Why search engine optimisation is important for your Business?",
"parameters": "",
"character_count": 400,
"source_language": "en",
"category": "Paraphrase",
"temperature": 0.7,
"n_gen": 5,
"api_key": "YOUR_API_KEY"
});
var config = {
method: 'post',
url: 'https://api.textcortex.com/hemingwai/generate_text',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Get into contact with us.
Meet with our team and learn how TextCortex AI can turbocharge your content.