Skip to content
This repository was archived by the owner on Nov 8, 2025. It is now read-only.

jermainee/writer.md-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEO Blog Article Generator API

This API generates SEO-optimized blog articles using a given topic or keyword, leveraging OpenAI's GPT-4 model. The output can be customized in different languages and formats (HTML or Markdown).

Features

  • SEO-Optimized Blog Article Generation: Generates articles based on a given keyword, language, and format.
  • Multiple Languages Supported: English, German, Dutch, Spanish, and Italian.
  • HTML or Markdown: Choose the format of the generated content.
  • Real-time Streaming: The article is streamed to the client as it is being generated.
  • API Key Validation: Validates if the OpenAI API key is working correctly.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/seo-blog-article-generator-api.git
    cd seo-blog-article-generator-api
  2. Install dependencies:

    Create and activate a virtual environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`

    Install required packages:

    pip install -r requirements.txt
  3. Set up environment variables:

    Copy .env.example to .env and replace YOUR_OPENAI_API_KEY with your actual OpenAI API key:

    cp .env.example .env

    Then, open the .env file and configure the following variables:

    OPENAI_API_KEY=your-openai-api-key
    
  4. Run the application:

    python main.py

    The app will be running on http://localhost:5000.

API Endpoints

1. Health Check

GET /

Returns a simple "Hello World" message to check if the API is up and running.

2. Validate API Key

GET /validate

Checks if the OpenAI API key is valid.

Response:

{
  "success": true
}

3. Generate SEO Optimized Blog Article

GET /generate/{keyword}

Generates an SEO-optimized blog article based on the provided keyword, language, and format.

  • Path Parameter:

    • keyword (string, required): The keyword or topic for the blog article.
  • Query Parameters:

    • language (string, required): Language of the generated blog article. Options: en, de, nl, es, it.
    • format (string, optional): The format of the generated content. Options: markdown (default), html.

Example Request:

curl "http://localhost:5000/generate/digital-marketing?language=en&format=html"

Response:

Returns a stream of the blog article content in the requested format (Markdown or HTML).

Usage Example

To generate an article about "digital marketing" in English and HTML format:

curl "http://localhost:5000/generate/digital-marketing?language=en&format=html"

The server will start streaming the blog article as it's being generated.

Environment Variables

The following environment variables need to be set:

  • OPENAI_API_KEY: Your OpenAI API key to interact with GPT models.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors