Local cluster content generation
Request samples
Python
Node.js
import requests
api_host = "https://api.seocontent.ai"
api_key = "your_api_key"
project_title = "api_mc5"
counts = {
"primary_count": 1000,
"secondary_count": 1000,
}
additional = {
"seo_title": True,
"seo_meta": True,
"seo_faq": True,
"seo_tagline": True,
"seo_contact": True,
"negative_words": ["facility"],
"find_and_replace": {"facility": "services"},
"phrase_blocking": [
"Facilities",
"Rent",
"Pays",
"Religion",
"Health conditions",
],
"tone": "Default",
"featured_image": True,
"h2_images": True,
}
img_generation = "Realistic Vision v2.0"
interlinking = True
content_language = "English"
content_type = "multi_cluster"
keywords = [
"what is assisted living",
"how much does assisted living cost",
# ... Add more keywords if needed
]
data = {
"keywords": keywords,
"project_title": project_title,
"counts": counts,
"additional": additional,
"content_type": content_type,
"content_language": content_language,
"img_generation": img_generation,
"interlinking": interlinking,
"interlinking_type": "infinte_interlinking",
"clustersize": 3,
}
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 project_title = "api_lc01";
// const currentDate = new Date().toISOString().slice(0, 10);
// console.log(currentDate); // output: 2023-04-06
// const req_date = currentDate;
// const datetime = new Date().toISOString();
// const user_id = "12345678990";
// const project_id = uuidv4();
// const use_type = "website";
const counts = {
primary_count: 1000,
secondary_count: 600,
};
const additional = {
seo_title: true,
seo_meta: true,
seo_faq: true,
seo_tagline: true,
seo_contact: true,
negative_words: ["facility"],
find_and_replace: { facility: "services" },
phrase_blocking: [
"Facilities",
"Rent",
"Pays",
"Religion",
"Health conditions",
],
tone: "Default",
featured_image: true,
h2_images: true,
};
const interlinking = true;
const content_language = "English";
const content_type = "local_cluster";
const keywords = [
["what is assisted living", "how much does assisted living cost"],
["Elder Living"],
];
const business_NAP = {
Name: "Generations",
Address: "1205 N Fairfield Road",
Phone: "801-829-9050",
City: "Layton",
Zipcode: 84041,
State: "Utah",
};
// See The Commented code
const img_generation = "Realistic Vision v2.0";
// Business Name: Generations
// Business Address: 1205 N Fairfield Road
// Business Phone: 801-829-9050
// Business City: Layton
// Business Zip: 84041
// Business State: UT
// if (img_generation != "None") {
// additional["featured_image"] = true;
// additional["h2_images"] = true;
// // data["interlinking_type"] = "subtopic_linking";
// } else {
// additional["featured_image"] = false;
// additional["h2_images"] = false;
// }
var data = {
keywords: keywords,
project_title: project_title,
counts: counts,
additional: additional,
interlinking: interlinking,
interlinking_type: "infinte_interlinking",
content_type: content_type,
content_language: content_language,
business_NAP: business_NAP,
img_generation: img_generation,
contact_link: "contact",
linking_strategy: "location_linking",
};
// if (additional["seo_contact"] == true) {
// data["contact_link"] = "contact";
// }
// if (interlinking == true) {
// // data["interlinking_type"] = "infinte_interlinking";s
// // data["linking_strategy"] = "standard_linking";
// data["linking_strategy"] = "location_linking";
// // data["linking_strategy"]="topic_linking"
// // data["linking_strategy"]="location_topic_linking"
// data["interlinking_type"] = "subtopic_linking";
// }
// console.log(JSON.stringify(data));
// Usage example:
(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_mc5”.
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., 1000.
- 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.
img_generation
(string)- Image generation type, e.g., “Realistic Vision v2.0”.
interlinking
(boolean)- Enable or disable interlinking.
content_language
(string)- Language of the content, e.g., “English”.
content_type
(string)- Type of content, e.g., “multi_cluster”.
keywords
(array of strings)- List of keywords for the content.
interlinking_type
(string)- Type of interlinking, e.g., “infinte_interlinking”.
clustersize
(integer)- Size of the cluster, e.g. 3.
Notes:
- Ensure that the
api_key
is correctly set. - Customize the parameters according to your specific requirements.