> ## 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.

# Evaluate Website

> API endpoint to evaluate website performance and provide recommendations

## 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/evaluate-website' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://example.com"
}'
```


## OpenAPI

````yaml POST /codenull/ai/api/v1/evaluate-website
openapi: 3.1.0
info:
  title: codenull-ai-backend
  version: 0.1.0
servers: []
security: []
paths:
  /codenull/ai/api/v1/evaluate-website:
    post:
      tags:
        - evaluate-website
      summary: Evaluate website performance
      description: >-
        Analyzes a URL for both desktop and mobile strategies and returns
        performance metrics as JSON.
      operationId: api-evaluate_website
      parameters:
        - name: category
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
            description: >-
              Categories to analyze (PERFORMANCE, ACCESSIBILITY, BEST_PRACTICES,
              SEO, PWA)
            default:
              - PERFORMANCE
              - SEO
              - BEST_PRACTICES
              - ACCESSIBILITY
            title: Category
          description: >-
            Categories to analyze (PERFORMANCE, ACCESSIBILITY, BEST_PRACTICES,
            SEO, PWA)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebsiteRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebsiteStats'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WebsiteRequest:
      properties:
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
        project_id:
          type: string
          title: Project Id
      type: object
      required:
        - url
        - project_id
      title: WebsiteRequest
      description: Request model for website evaluation.
    WebsiteStats:
      properties:
        url:
          type: string
          title: Url
        desktop:
          $ref: '#/components/schemas/StrategyResults'
        mobile:
          $ref: '#/components/schemas/StrategyResults'
      type: object
      required:
        - url
        - desktop
        - mobile
      title: WebsiteStats
      description: Response model for website performance statistics.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StrategyResults:
      properties:
        performance_score:
          type: number
          title: Performance Score
        first_contentful_paint:
          anyOf:
            - type: number
            - type: 'null'
          title: First Contentful Paint
        speed_index:
          anyOf:
            - type: number
            - type: 'null'
          title: Speed Index
        largest_contentful_paint:
          anyOf:
            - type: number
            - type: 'null'
          title: Largest Contentful Paint
        time_to_interactive:
          anyOf:
            - type: number
            - type: 'null'
          title: Time To Interactive
        total_blocking_time:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Blocking Time
        cumulative_layout_shift:
          anyOf:
            - type: number
            - type: 'null'
          title: Cumulative Layout Shift
        loading_experience:
          anyOf:
            - $ref: '#/components/schemas/LoadingExperience'
            - type: 'null'
        origin_loading_experience:
          anyOf:
            - $ref: '#/components/schemas/LoadingExperience'
            - type: 'null'
        opportunities:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Opportunities
        diagnostics:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Diagnostics
        categories:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/CategoryResults'
              type: object
            - type: 'null'
          title: Categories
      type: object
      required:
        - performance_score
      title: StrategyResults
      description: Model for strategy-specific results.
    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
    LoadingExperience:
      properties:
        id:
          type: string
          title: Id
        metrics:
          $ref: '#/components/schemas/LoadingExperienceMetrics'
        overall_category:
          type: string
          title: Overall Category
        initial_url:
          type: string
          title: Initial Url
      type: object
      required:
        - id
        - metrics
        - overall_category
        - initial_url
      title: LoadingExperience
      description: Model for loading experience data.
    CategoryResults:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        score:
          type: number
          title: Score
        manualDescription:
          anyOf:
            - type: string
            - type: 'null'
          title: Manualdescription
        auditRefs:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Auditrefs
      type: object
      required:
        - id
        - title
        - score
      title: CategoryResults
      description: Model for category-specific results.
    LoadingExperienceMetrics:
      properties:
        first_contentful_paint:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: First Contentful Paint
        first_input_delay:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: First Input Delay
        largest_contentful_paint:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Largest Contentful Paint
        cumulative_layout_shift:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Cumulative Layout Shift
        interaction_to_next_paint:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Interaction To Next Paint
      type: object
      title: LoadingExperienceMetrics
      description: Model for loading experience metrics.

````