Single cluster content generation
Request samples
Python
Node.js
import requests
api_host = "https://api.seocontent.ai"
api_key = "your_api_key"
if not api_key:
raise ValueError("Missing SEOCONTENT AI API key.")
project_title = "api_sc02"
keywords = [
[
"what is assisted living?",
"what is assisted living mean?",
"what exactly is assisted living?",
# "what is considered assisted living?",
# "what is an assisted living facility?",
# "what is an assisted living home?",
# "what is an assisted living community?",
# "what is a residential assisted living?",
# "what is a type b assisted living facility?",
# "what is a residential assisted living facility?",
# "what is a med tech in assisted living?",
# "what is a assisted living home?",
# "what care is provided in assisted living?",
],
[
"what is level 1 care in assisted living?",
"what is level 2 care in assisted living?",
# "what is level 3 care in assisted living?",
# "what is level 4 care in assisted Living?",
# "what is level 5 care in assisted living?",
],
]
content_type = "single_cluster"
interlinking = True
img_generation = "None"
counts = {
"primary_count": 1000,
"secondary_count": 600,
}
additional = {
"seo_title": True,
"seo_meta": True,
"seo_faq": False,
"seo_tagline": False,
"seo_contact": False,
"negative_words": ["facility"],
"phrase_blocking": ["Facilities", "Rent", "Pays", "Religion", "Health conditions"],
# "find_and_replace": {"facility": "factory", "storage": "warehouse"},
"tone": "Informative",
"featured_image": True,
"h2_images": True,
}
# Uncomment the following lines if img_generation is not "None"
# additional["featured_image"] = True
# additional["h2_images"] = False
# data["interlinking_type"] = "subtopic_linking"
content_language = "English"
data = {
"keywords": keywords,
"project_title": project_title,
"counts": counts,
"additional": additional,
"interlinking": interlinking,
"content_type": content_type,
"content_language": content_language,
"img_generation": img_generation,
"interlinking": interlinking,
}
if interlinking:
data["interlinking_type"] = "subtopic_linking"
print(data)
headers = {
"Content-Type": "application/json",
"x-api-key": api_key,
}
response = requests.post(
f"{api_host}/v1/content-generator/",
json=data,
headers=headers
)
print("Response:", response.text) # Log the response data
print(response.status_code)
const axios = require("axios");
const apiHost = process.env.API_HOST || "https://api.seocontent.ai";
const apiKey = "your_api_key";
if (!apiKey) throw new Error("Missing SEOCONTENT AI API key.");
const requestConfig = {
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
};
const generateContent = async () => {
try {
const response = await axios.post(
`${apiHost}/v1/content-generator/`,
data,
requestConfig
);
if (response.status !== 200) {
throw new Error(`Non-200 response: ${response.statusText}`);
}
return response.data; // Return the response data
} catch (error) {
throw new Error(`Error generating content: ${error.message}`);
}
};
const keywords = [
[
"what is assisted living?",
"what is assisted living mean?",
"what exactly is assisted living?",
// "what is considered assisted living?",
// "what is an assisted living facility?",
// "what is an assisted living home?",
// "what is an assisted living community?",
// "what is a residential assisted living?",
// "what is a type b assisted living facility?",
// "what is a residential assisted living facility?",
// "what is a med tech in assisted living?",
// "what is a assisted living home?",
// "what care is provided in assisted living?",
],
[
"what is level 1 care in assisted living?",
"what is level 2 care in assisted living?",
// "what is level 3 care in assisted living?",
// "what is level 4 care in assisted Living?",
// "what is level 5 care in assisted living?",
],
];
const project_title = "api_sc03";
const content_type = "single_cluster";
const interlinking = true;
const img_generation = "None";
const counts = {
primary_count: 1000,
secondary_count: 600,
};
const additional = {
seo_title: true,
seo_meta: true,
seo_faq: false,
seo_tagline: false,
seo_contact: false,
negative_words: ["facility"],
phrase_blocking: [
"Facilities",
"Rent",
"Pays",
"Religion",
"Health conditions",
],
// find_and_replace: { facility: "factory", storage: "warehouse" },
tone: "Informative",
featured_image: true,
h2_images: true,
};
// if (img_generation != "None") {
// additional["featured_image"] = true;
// additional["h2_images"] = false;
// // data["interlinking_type"] = "subtopic_linking";
// } else {
// additional["featured_image"] = false;
// additional["h2_images"] = false;
// }
const content_language = "English";
var data = {
keywords: keywords,
project_title: project_title,
counts: counts,
additional: additional,
interlinking: interlinking,
content_type: content_type,
content_language: content_language,
img_generation: img_generation,
interlinking: interlinking,
interlinking_type: "infinte_interlinking",
};
if (interlinking == true) {
// data["interlinking_type"] = "infinte_interlinking";
data["interlinking_type"] = "subtopic_linking";
}
console.log(JSON.stringify(data));
(async () => {
try {
const responseJSON = await generateContent();
console.log("Response:", responseJSON); // Log the response data
console.log("Your Content will be generated");
} catch (error) {
console.error("Error:", error.message);
}
})();
AUTHORIZATIONS: SEOCONTENT_API_KEY
HEADER PARAMETERS:
- Content-Type: application/json
- x-api-key: Your API key
BODY PARAMETERS:
project_title
(string)- The title of the project, e.g., “api_sc02”.
keywords
(array of arrays of strings)- A list of keyword groups for the content, each group containing related keywords.
content_type
(string)- Type of content, e.g.,
"single_cluster"
.
- Type of content, e.g.,
interlinking
(boolean)- Enable or disable interlinking.
img_generation
(string)- Image generation type, e.g.,
"None"
- Image generation type, e.g.,
counts
(object)- An object containing the primary and secondary counts:
primary_count
: (integer) The primary count value, e.g., 1000.secondary_count
: (integer) The secondary count value, e.g., 600.
- An object containing the primary and secondary counts:
additional
(object) : An object containing additional Seo-related parameters:- seo_title: (boolean) Include SEO title.
- seo_meta: (boolean) Include SEO meta tags.
- seo_faq: (boolean) Include SEO FAQ.
- seo_tagline: (boolean) Include SEO tagline.
- seo_contact: (boolean) Include SEO contact information.
- negative_words: (array of strings) List of negative words, e.g., [“facility”].
- find_and_replace: (object) Find and replace specific words, e.g., {“facility”: “services”}.
- phrase_blocking: (array of strings) List of phrases to block.
- tone: (string) Tone of the content, e.g., “Default”.
- featured_image: (boolean) Include a featured image.
- h2_images: (boolean) Include H2 images.
content_language
(string)- Language of the content, e.g.,
"English"
.
- Language of the content, e.g.,
interlinking_type
(string, optional)- Type of interlinking, e.g.,
"subtopic_linking"
. Only required ifinterlinking
is set toTrue
.
- Type of interlinking, e.g.,
Notes:
- Ensure that the
api_key
is correctly set. - Customize the parameters according to your specific requirements.
- If
img_generation
is not"None"
, you may need to uncomment the lines related tofeatured_image
andh2_images
. - If
interlinking
isTrue
, you must include theinterlinking_type
parameter.