Endpoints
Learn how to integrate our AI content generation API into your application
Authentication
All API requests require authentication using a bearer token. Include your token in the Authorization header:
Authorization: Bearer YOUR_BEARER_TOKEN
You can get your user ID and token from the dashboard.
Generate Article
POST /generate-article
Generate a detailed, well-researched article using AI
Parameters
Parameter | Type | Required | Description |
topic | string | Yes | The main topic or title for the article |
length | string | No | Desired length ('short', 'medium', 'long'). Defaults to 'medium' |
focus | string | No | Article focus ('research', 'analysis', 'review'). Defaults to 'analysis' |
audience | string | No | Target audience ('general', 'academic', 'expert'). Defaults to 'general' |
Example Request
curl -X POST http://api.instapress.ai/generate-article?user_id=<USER_ID> \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"topic": "The Future of Renewable Energy",
"length": "long",
"focus": "research",
"audience": "academic"
}'
Example Response
{
"success": true,
"content": "<article style=\"color: #2C3E50; background-color: #ECF0F1\">\n <h1 style=\"color: #3498DB\">The Future of Renewable Energy</h1>\n <p>Renewable energy sources are rapidly transforming the global energy landscape. As we move towards a more sustainable future, technological advancements and decreasing costs are making renewable energy increasingly viable.</p>\n \n <h2 style=\"color: #3498DB\">Solar Power Revolution</h2>\n <p>Solar technology has seen remarkable improvements in efficiency and cost-effectiveness. Recent studies indicate that photovoltaic cells have achieved conversion rates exceeding 45% in laboratory conditions.</p>\n \n <h2 style=\"color: #3498DB\">Wind Energy Expansion</h2>\n <p>Offshore wind farms are becoming increasingly prevalent, with floating turbines opening up new possibilities for energy generation in deeper waters.</p>\n \n <h2 style=\"color: #3498DB\">Conclusion</h2>\n <p>The transition to renewable energy sources appears not just inevitable, but economically advantageous. As technology continues to evolve, we can expect to see even more innovative solutions emerge.</p>\n</article>"
}
Generate Blog Post
POST /generate-blog
Generate an engaging blog post optimized for your audience
Parameters
Parameter | Type | Required | Description |
topic | string | Yes | The main topic or title for the blog post |
length | string | No | Desired length ('short', 'medium', 'long'). Defaults to 'medium' |
style | string | No | Writing style ('casual', 'professional', 'technical'). Defaults to 'professional' |
format | string | No | Blog format ('howto', 'listicle', 'narrative'). Defaults to 'narrative' |
Example Request
curl -X POST http://api.instapress.ai/generate-blog?user_id=<USER_ID> \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"topic": "10 Tips for Remote Work Success",
"length": "medium",
"style": "professional",
"format": "listicle"
}'
Example Response
{
"success": true,
"content": "<article class=\"blog-post\" style=\"color: #1A237E; background-color: #FFFFFF\">\n <h1 style=\"color: #4CAF50\">10 Tips for Remote Work Success</h1>\n \n <p class=\"intro\" style=\"color: #1A237E\">Working from home has become the new normal for many of us. Here's how to make the most of it! 🏠💻</p>\n \n <h2 style=\"color: #4CAF50\">1. Create a Dedicated Workspace</h2>\n <p>Find a quiet corner that's just for work. Trust me, your bed isn't the best office! 🛋️</p>\n \n <h2 style=\"color: #4CAF50\">2. Stick to a Schedule</h2>\n <p>Just because you're home doesn't mean you should work in your PJs all day (though sometimes it's nice!).</p>\n \n <div class=\"pro-tip\" style=\"background-color: #4CAF50; color: #FFFFFF; padding: 1rem; border-radius: 0.5rem;\">\n <h3>Pro Tip</h3>\n <p>Use time-blocking to manage your day effectively and maintain work-life balance.</p>\n </div>\n \n <p class=\"conclusion\">Remember, remote work is a skill that gets better with practice. Be patient with yourself!</p>\n</article>"
}
Generate News Article
POST /generate-news
Generate a news-style article with journalistic standards
Parameters
Parameter | Type | Required | Description |
topic | string | Yes | The main topic or headline for the news article |
length | string | No | Desired length ('short', 'medium', 'long'). Defaults to 'medium' |
tone | string | No | Writing tone ('neutral', 'investigative', 'editorial'). Defaults to 'neutral' |
Example Request
curl -X POST http://api.instapress.ai/generate-news?user_id=<USER_ID> \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"topic": "Tech Industry Embraces AI Innovation",
"length": "medium",
"tone": "neutral"
}'
Example Response
{
"success": true,
"content": "<article class=\"news-article\" style=\"color: #212121; background-color: #FAFAFA\">\n <header>\n <h1 style=\"color: #0D47A1\">Tech Industry Embraces AI Innovation</h1>\n <p class=\"byline\" style=\"color: #212121\">By BlogAI | <time datetime=\"2024-02-20\">February 20, 2024</time></p>\n </header>\n\n <p class=\"lead\" style=\"color: #0D47A1; font-weight: 500\">In a significant shift within the technology sector, major companies are increasingly integrating artificial intelligence into their core products and services.</p>\n\n <div class=\"article-body\">\n <p>Industry leaders announced today a series of groundbreaking AI initiatives, marking a new chapter in technological advancement. The developments span various applications, from consumer products to enterprise solutions.</p>\n\n <blockquote style=\"border-left: 4px solid #0D47A1; padding-left: 1rem;\">\n <p>\"AI is no longer just a buzzword—it's becoming the foundation of how we build and improve our products,\" says a leading tech executive.</p>\n </blockquote>\n\n <h2 style=\"color: #0D47A1\">Market Impact</h2>\n <p>The stock market responded positively to these announcements, with tech sector indices showing notable gains.</p>\n </div>\n</article>"
}