๐ŸŽฏ BrightEdge Assignment - Page Classifier API

๐Ÿ” Try It Now!

Enter any URL to see what topics our algorithm extracts from that page.

๐Ÿ“Š Classification Results

๐Ÿ“‹ Page Classification

This API classifies web pages and returns a list of relevant topics using custom density analysis.

Key Features:

๐Ÿš€ API Endpoints

GET POST /api/classify

Classify a single URL and get relevant topics

GET  /api/classify?url=https://example.com&limit=10
POST /api/classify
     Body: {"url": "https://example.com", "limit": 10}
POST /api/classify/batch

Classify multiple URLs in one request (max 10 URLs)

POST /api/classify/batch
     Body: {"urls": ["url1", "url2"], "limit": 10}
GET /api/classify/test

Test with predefined assignment URLs

GET /api/classify/test           (runs all test URLs)
GET /api/classify/test?index=0   (runs specific test)
GET /api/classify/help

Get API documentation

๐Ÿงช Test URLs from Assignment

  1. Amazon Toaster Product Page
  2. REI Blog Post
  3. CNN Article

Run All Tests โ†’

๐Ÿ’ก Quick Examples

Example 1: Classify a URL

curl "http://localhost:8000/api/classify?url=https://example.com"

Example 2: Test with Assignment URLs

curl "http://localhost:8000/api/classify/test"

Example 3: Batch Classification

curl -X POST http://localhost:8000/api/classify/batch \
  -H "Content-Type: application/json" \
  -d '{"urls": ["url1", "url2"], "limit": 10}'

๐Ÿ“š Additional Resources

Built by Deepak Singh Parihar