> ## Documentation Index
> Fetch the complete documentation index at: https://shivamgoyal.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimize SEO

> API endpoint to optimize content for search engine visibility

## Example Usage

For complete API documentation and examples, please refer to your [Swagger UI](https://localhost:8080/docs#/).

```bash theme={null}
curl -X 'POST' \
  'https://localhost:8080/codenull/ai/api/v1/optimize-seo' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "context": "Website about healthcare services",
  "originalContent": [
    {
      "tagname": "h1",
      "content": "Welcome to our services"
    },
    {
      "tagname": "p",
      "content": "We offer various medical treatments for patients."
    },
    {
      "tagname": "h2",
      "content": "Our treatments"
    }
  ]
}'
```


## OpenAPI

````yaml POST /codenull/ai/api/v1/optimize-seo
openapi: 3.1.0
info:
  title: codenull-ai-backend
  version: 0.1.0
servers: []
security: []
paths:
  /codenull/ai/api/v1/optimize-seo:
    post:
      tags:
        - optimize-seo
      summary: Optimize Seo
      description: |-
        Endpoint to optimize content for SEO.

        This endpoint takes the original content and optional context,
        processes it through an SEO agent that leverages search engine data,
        and returns SEO-optimized content.

        Returns the optimized content with preserved HTML tags.
      operationId: api-optimize_seo
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SEORequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SEOResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SEORequest:
      properties:
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
          description: Additional context for SEO optimization
        originalContent:
          items:
            $ref: '#/components/schemas/ContentItem'
          type: array
          title: Originalcontent
          description: Original content to be optimized
      type: object
      required:
        - originalContent
      title: SEORequest
    SEOResponse:
      properties:
        optContent:
          items:
            $ref: '#/components/schemas/ContentItem'
          type: array
          title: Optcontent
          description: Optimized content
      type: object
      required:
        - optContent
      title: SEOResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContentItem:
      properties:
        tagname:
          type: string
          title: Tagname
        content:
          type: string
          title: Content
      type: object
      required:
        - tagname
        - content
      title: ContentItem
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````