Spaces:
Running
Running
prince1604 commited on
Commit ·
7db0953
1
Parent(s): 37260b4
Add complete API reference with all parameters
Browse files- COMPLETE_API_REFERENCE.md +522 -0
- WORKING_POSTMAN_URLS.md +245 -0
COMPLETE_API_REFERENCE.md
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🎯 COMPLETE API REFERENCE - POSTMAN READY
|
| 2 |
+
|
| 3 |
+
**Base URL (Local)**: `http://127.0.0.1:7860`
|
| 4 |
+
**Base URL (HF)**: `https://ubuntu593-alt-scraper-api.hf.space`
|
| 5 |
+
|
| 6 |
+
**Status**: ✅ LOCAL WORKING | ⏳ HF PENDING SYNC
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
## 📋 ENDPOINT 1: Health Check
|
| 11 |
+
|
| 12 |
+
### Request Details
|
| 13 |
+
- **Method**: `GET`
|
| 14 |
+
- **Endpoint**: `/health`
|
| 15 |
+
- **Parameters**: None
|
| 16 |
+
|
| 17 |
+
### Postman Setup
|
| 18 |
+
```
|
| 19 |
+
GET http://127.0.0.1:7860/health
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
### Response
|
| 23 |
+
```json
|
| 24 |
+
{
|
| 25 |
+
"status": "alive"
|
| 26 |
+
}
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
**Status Code**: 200 OK
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## 📋 ENDPOINT 2: System Status
|
| 34 |
+
|
| 35 |
+
### Request Details
|
| 36 |
+
- **Method**: `GET`
|
| 37 |
+
- **Endpoint**: `/api/status`
|
| 38 |
+
- **Parameters** (Query, Optional):
|
| 39 |
+
- `domain` (string): Target URL to check connectivity
|
| 40 |
+
|
| 41 |
+
### Postman Setup
|
| 42 |
+
**URL**: `http://127.0.0.1:7860/api/status`
|
| 43 |
+
|
| 44 |
+
**Params Tab**:
|
| 45 |
+
| Key | Value | Description |
|
| 46 |
+
|-----|-------|-------------|
|
| 47 |
+
| domain | `https://wpengine.com` | Optional: Domain to test |
|
| 48 |
+
|
| 49 |
+
**Full URL Example**:
|
| 50 |
+
```
|
| 51 |
+
http://127.0.0.1:7860/api/status?domain=https://wpengine.com
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
### Response
|
| 55 |
+
```json
|
| 56 |
+
{
|
| 57 |
+
"region": "Mumbai, IN",
|
| 58 |
+
"latency": 45,
|
| 59 |
+
"status": "operational",
|
| 60 |
+
"engine": "AutoAlt Neural v2"
|
| 61 |
+
}
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
**Status Code**: 200 OK
|
| 65 |
+
|
| 66 |
+
---
|
| 67 |
+
|
| 68 |
+
## 📋 ENDPOINT 3: Start Scan
|
| 69 |
+
|
| 70 |
+
### Request Details
|
| 71 |
+
- **Method**: `POST`
|
| 72 |
+
- **Endpoint**: `/api/scanstart`
|
| 73 |
+
- **Parameters** (Supports BOTH methods):
|
| 74 |
+
|
| 75 |
+
#### Method A: Query Parameters (Recommended)
|
| 76 |
+
| Parameter | Type | Required | Default | Description |
|
| 77 |
+
|-----------|------|----------|---------|-------------|
|
| 78 |
+
| `domain` | string | ✅ Yes | - | Website URL to scan |
|
| 79 |
+
| `limit` | integer | ⚠️ Optional | 25 | Max pages to crawl |
|
| 80 |
+
|
| 81 |
+
#### Method B: JSON Body (Alternative)
|
| 82 |
+
```json
|
| 83 |
+
{
|
| 84 |
+
"domain": "string (required)",
|
| 85 |
+
"limit": 25
|
| 86 |
+
}
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
### Postman Setup (Query Parameters) ✅ VERIFIED WORKING
|
| 90 |
+
|
| 91 |
+
**URL**: `http://127.0.0.1:7860/api/scanstart`
|
| 92 |
+
|
| 93 |
+
**Method**: `POST`
|
| 94 |
+
|
| 95 |
+
**Params Tab**:
|
| 96 |
+
| Key | Value | Example |
|
| 97 |
+
|-----|-------|---------|
|
| 98 |
+
| domain | `https://wpengine.com` | Any valid URL |
|
| 99 |
+
| limit | `26` | 1-100 recommended |
|
| 100 |
+
|
| 101 |
+
**Full URL**:
|
| 102 |
+
```
|
| 103 |
+
http://127.0.0.1:7860/api/scanstart?domain=https://wpengine.com&limit=26
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
### Postman Setup (JSON Body Alternative)
|
| 107 |
+
|
| 108 |
+
**URL**: `http://127.0.0.1:7860/api/scanstart`
|
| 109 |
+
|
| 110 |
+
**Method**: `POST`
|
| 111 |
+
|
| 112 |
+
**Body Tab**: Select `raw` → `JSON`
|
| 113 |
+
|
| 114 |
+
**Body Content**:
|
| 115 |
+
```json
|
| 116 |
+
{
|
| 117 |
+
"domain": "https://wpengine.com",
|
| 118 |
+
"limit": 26
|
| 119 |
+
}
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
**Headers** (auto-added):
|
| 123 |
+
```
|
| 124 |
+
Content-Type: application/json
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
### Response
|
| 128 |
+
```json
|
| 129 |
+
{
|
| 130 |
+
"job_id": "9923ef39-44aa-4ccf-b97b-f230153e2fc1"
|
| 131 |
+
}
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
**Status Code**: 200 OK
|
| 135 |
+
|
| 136 |
+
**⚠️ Save this `job_id`** - you'll need it for the next endpoints!
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## 📋 ENDPOINT 4: Check Scan Progress
|
| 141 |
+
|
| 142 |
+
### Request Details
|
| 143 |
+
- **Method**: `GET`
|
| 144 |
+
- **Endpoint**: `/api/progress` or `/api/progress/{job_id}`
|
| 145 |
+
- **Parameters**:
|
| 146 |
+
|
| 147 |
+
| Parameter | Type | Location | Required | Description |
|
| 148 |
+
|-----------|------|----------|----------|-------------|
|
| 149 |
+
| `job_id` | string | Query/Path | ✅ Yes | Job ID from scanstart |
|
| 150 |
+
|
| 151 |
+
### Postman Setup
|
| 152 |
+
|
| 153 |
+
**URL**: `http://127.0.0.1:7860/api/progress`
|
| 154 |
+
|
| 155 |
+
**Method**: `GET`
|
| 156 |
+
|
| 157 |
+
**Params Tab**:
|
| 158 |
+
| Key | Value |
|
| 159 |
+
|-----|-------|
|
| 160 |
+
| job_id | `9923ef39-44aa-4ccf-b97b-f230153e2fc1` |
|
| 161 |
+
|
| 162 |
+
**Full URL Example**:
|
| 163 |
+
```
|
| 164 |
+
http://127.0.0.1:7860/api/progress?job_id=9923ef39-44aa-4ccf-b97b-f230153e2fc1
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
**Alternative (Path Parameter)**:
|
| 168 |
+
```
|
| 169 |
+
http://127.0.0.1:7860/api/progress/9923ef39-44aa-4ccf-b97b-f230153e2fc1
|
| 170 |
+
```
|
| 171 |
+
|
| 172 |
+
### Response (While Running)
|
| 173 |
+
```json
|
| 174 |
+
{
|
| 175 |
+
"status": "running",
|
| 176 |
+
"percent": 60,
|
| 177 |
+
"pages_scanned": 15,
|
| 178 |
+
"images_found": 87,
|
| 179 |
+
"message": "Scanning: https://wpengine.com/about",
|
| 180 |
+
"elapsed_seconds": 12,
|
| 181 |
+
"eta_seconds": 8,
|
| 182 |
+
"error": null
|
| 183 |
+
}
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
### Response (When Complete)
|
| 187 |
+
```json
|
| 188 |
+
{
|
| 189 |
+
"status": "done",
|
| 190 |
+
"percent": 100,
|
| 191 |
+
"pages_scanned": 26,
|
| 192 |
+
"images_found": 145,
|
| 193 |
+
"message": "Completed",
|
| 194 |
+
"elapsed_seconds": 25,
|
| 195 |
+
"eta_seconds": null,
|
| 196 |
+
"error": null
|
| 197 |
+
}
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
### Response (If Error)
|
| 201 |
+
```json
|
| 202 |
+
{
|
| 203 |
+
"status": "error",
|
| 204 |
+
"percent": 0,
|
| 205 |
+
"pages_scanned": 0,
|
| 206 |
+
"images_found": 0,
|
| 207 |
+
"message": "Internal Error",
|
| 208 |
+
"elapsed_seconds": 5,
|
| 209 |
+
"eta_seconds": null,
|
| 210 |
+
"error": "Scan failed: Title: Just a moment"
|
| 211 |
+
}
|
| 212 |
+
```
|
| 213 |
+
|
| 214 |
+
**Status Code**: 200 OK (even for errors, check the `status` field)
|
| 215 |
+
|
| 216 |
+
**Possible Status Values**:
|
| 217 |
+
- `pending` - Job queued, not started yet
|
| 218 |
+
- `running` - Actively scanning
|
| 219 |
+
- `done` - Scan completed successfully
|
| 220 |
+
- `error` - Scan failed
|
| 221 |
+
|
| 222 |
+
---
|
| 223 |
+
|
| 224 |
+
## 📋 ENDPOINT 5: Get Scan Result
|
| 225 |
+
|
| 226 |
+
### Request Details
|
| 227 |
+
- **Method**: `GET`
|
| 228 |
+
- **Endpoint**: `/api/result` or `/api/result/{job_id}`
|
| 229 |
+
- **Parameters**:
|
| 230 |
+
|
| 231 |
+
| Parameter | Type | Location | Required | Description |
|
| 232 |
+
|-----------|------|----------|----------|-------------|
|
| 233 |
+
| `job_id` | string | Query/Path | ✅ Yes | Job ID from scanstart |
|
| 234 |
+
|
| 235 |
+
### Postman Setup
|
| 236 |
+
|
| 237 |
+
**URL**: `http://127.0.0.1:7860/api/result`
|
| 238 |
+
|
| 239 |
+
**Method**: `GET`
|
| 240 |
+
|
| 241 |
+
**Params Tab**:
|
| 242 |
+
| Key | Value |
|
| 243 |
+
|-----|-------|
|
| 244 |
+
| job_id | `9923ef39-44aa-4ccf-b97b-f230153e2fc1` |
|
| 245 |
+
|
| 246 |
+
**Full URL Example**:
|
| 247 |
+
```
|
| 248 |
+
http://127.0.0.1:7860/api/result?job_id=9923ef39-44aa-4ccf-b97b-f230153e2fc1
|
| 249 |
+
```
|
| 250 |
+
|
| 251 |
+
**Alternative (Path Parameter)**:
|
| 252 |
+
```
|
| 253 |
+
http://127.0.0.1:7860/api/result/9923ef39-44aa-4ccf-b97b-f230153e2fc1
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
+
### Response (If Not Ready)
|
| 257 |
+
```json
|
| 258 |
+
{
|
| 259 |
+
"status": "running",
|
| 260 |
+
"message": "Result not ready yet"
|
| 261 |
+
}
|
| 262 |
+
```
|
| 263 |
+
|
| 264 |
+
### Response (When Complete)
|
| 265 |
+
```json
|
| 266 |
+
{
|
| 267 |
+
"summary": {
|
| 268 |
+
"total_pages_scanned": 26,
|
| 269 |
+
"total_images_found": 145,
|
| 270 |
+
"total_images_missing_alt": 23,
|
| 271 |
+
"total_images_poor_quality": 5,
|
| 272 |
+
"total_pages_discovered": 50,
|
| 273 |
+
"blocked_reason": null,
|
| 274 |
+
"crawl_blocked": false
|
| 275 |
+
},
|
| 276 |
+
"details": [
|
| 277 |
+
{
|
| 278 |
+
"page_url": "https://wpengine.com/",
|
| 279 |
+
"images": [
|
| 280 |
+
{
|
| 281 |
+
"src": "https://wpengine.com/logo.png",
|
| 282 |
+
"alt": "Company Logo",
|
| 283 |
+
"missing_alt": false,
|
| 284 |
+
"poor_quality": false,
|
| 285 |
+
"dimensions": "1200x630"
|
| 286 |
+
}
|
| 287 |
+
]
|
| 288 |
+
}
|
| 289 |
+
]
|
| 290 |
+
}
|
| 291 |
+
```
|
| 292 |
+
|
| 293 |
+
**Status Code**: 200 OK
|
| 294 |
+
|
| 295 |
+
---
|
| 296 |
+
|
| 297 |
+
## 🔄 COMPLETE WORKFLOW IN POSTMAN
|
| 298 |
+
|
| 299 |
+
### Step 1: Start a Scan
|
| 300 |
+
```
|
| 301 |
+
POST http://127.0.0.1:7860/api/scanstart?domain=https://wpengine.com&limit=26
|
| 302 |
+
```
|
| 303 |
+
**Save the `job_id` from response!**
|
| 304 |
+
|
| 305 |
+
---
|
| 306 |
+
|
| 307 |
+
### Step 2: Poll for Progress (repeat every 2 seconds)
|
| 308 |
+
```
|
| 309 |
+
GET http://127.0.0.1:7860/api/progress?job_id=YOUR_JOB_ID
|
| 310 |
+
```
|
| 311 |
+
**Wait until `status` = `"done"`**
|
| 312 |
+
|
| 313 |
+
---
|
| 314 |
+
|
| 315 |
+
### Step 3: Get Final Result
|
| 316 |
+
```
|
| 317 |
+
GET http://127.0.0.1:7860/api/result?job_id=YOUR_JOB_ID
|
| 318 |
+
```
|
| 319 |
+
**Receive full scan report!**
|
| 320 |
+
|
| 321 |
+
---
|
| 322 |
+
|
| 323 |
+
## 📦 POSTMAN COLLECTION (IMPORT THIS)
|
| 324 |
+
|
| 325 |
+
Save as `alt-scraper-api.postman_collection.json`:
|
| 326 |
+
|
| 327 |
+
```json
|
| 328 |
+
{
|
| 329 |
+
"info": {
|
| 330 |
+
"name": "Alt Scraper API - Complete",
|
| 331 |
+
"description": "Full API with all parameters - Tested & Working",
|
| 332 |
+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
| 333 |
+
},
|
| 334 |
+
"variable": [
|
| 335 |
+
{
|
| 336 |
+
"key": "base_url",
|
| 337 |
+
"value": "http://127.0.0.1:7860",
|
| 338 |
+
"type": "string"
|
| 339 |
+
},
|
| 340 |
+
{
|
| 341 |
+
"key": "job_id",
|
| 342 |
+
"value": "",
|
| 343 |
+
"type": "string"
|
| 344 |
+
}
|
| 345 |
+
],
|
| 346 |
+
"item": [
|
| 347 |
+
{
|
| 348 |
+
"name": "1. Health Check",
|
| 349 |
+
"request": {
|
| 350 |
+
"method": "GET",
|
| 351 |
+
"header": [],
|
| 352 |
+
"url": {
|
| 353 |
+
"raw": "{{base_url}}/health",
|
| 354 |
+
"host": ["{{base_url}}"],
|
| 355 |
+
"path": ["health"]
|
| 356 |
+
}
|
| 357 |
+
}
|
| 358 |
+
},
|
| 359 |
+
{
|
| 360 |
+
"name": "2. System Status",
|
| 361 |
+
"request": {
|
| 362 |
+
"method": "GET",
|
| 363 |
+
"header": [],
|
| 364 |
+
"url": {
|
| 365 |
+
"raw": "{{base_url}}/api/status?domain=https://wpengine.com",
|
| 366 |
+
"host": ["{{base_url}}"],
|
| 367 |
+
"path": ["api", "status"],
|
| 368 |
+
"query": [
|
| 369 |
+
{
|
| 370 |
+
"key": "domain",
|
| 371 |
+
"value": "https://wpengine.com",
|
| 372 |
+
"description": "Optional: Domain to test connectivity"
|
| 373 |
+
}
|
| 374 |
+
]
|
| 375 |
+
}
|
| 376 |
+
}
|
| 377 |
+
},
|
| 378 |
+
{
|
| 379 |
+
"name": "3. Start Scan (Query Params)",
|
| 380 |
+
"event": [
|
| 381 |
+
{
|
| 382 |
+
"listen": "test",
|
| 383 |
+
"script": {
|
| 384 |
+
"exec": [
|
| 385 |
+
"// Auto-save job_id to environment",
|
| 386 |
+
"const response = pm.response.json();",
|
| 387 |
+
"pm.collectionVariables.set('job_id', response.job_id);",
|
| 388 |
+
"console.log('Job ID saved:', response.job_id);"
|
| 389 |
+
],
|
| 390 |
+
"type": "text/javascript"
|
| 391 |
+
}
|
| 392 |
+
}
|
| 393 |
+
],
|
| 394 |
+
"request": {
|
| 395 |
+
"method": "POST",
|
| 396 |
+
"header": [],
|
| 397 |
+
"url": {
|
| 398 |
+
"raw": "{{base_url}}/api/scanstart?domain=https://wpengine.com&limit=26",
|
| 399 |
+
"host": ["{{base_url}}"],
|
| 400 |
+
"path": ["api", "scanstart"],
|
| 401 |
+
"query": [
|
| 402 |
+
{
|
| 403 |
+
"key": "domain",
|
| 404 |
+
"value": "https://wpengine.com",
|
| 405 |
+
"description": "Target website URL"
|
| 406 |
+
},
|
| 407 |
+
{
|
| 408 |
+
"key": "limit",
|
| 409 |
+
"value": "26",
|
| 410 |
+
"description": "Max pages to crawl (default: 25)"
|
| 411 |
+
}
|
| 412 |
+
]
|
| 413 |
+
}
|
| 414 |
+
}
|
| 415 |
+
},
|
| 416 |
+
{
|
| 417 |
+
"name": "3b. Start Scan (JSON Body)",
|
| 418 |
+
"event": [
|
| 419 |
+
{
|
| 420 |
+
"listen": "test",
|
| 421 |
+
"script": {
|
| 422 |
+
"exec": [
|
| 423 |
+
"const response = pm.response.json();",
|
| 424 |
+
"pm.collectionVariables.set('job_id', response.job_id);"
|
| 425 |
+
],
|
| 426 |
+
"type": "text/javascript"
|
| 427 |
+
}
|
| 428 |
+
}
|
| 429 |
+
],
|
| 430 |
+
"request": {
|
| 431 |
+
"method": "POST",
|
| 432 |
+
"header": [
|
| 433 |
+
{
|
| 434 |
+
"key": "Content-Type",
|
| 435 |
+
"value": "application/json"
|
| 436 |
+
}
|
| 437 |
+
],
|
| 438 |
+
"body": {
|
| 439 |
+
"mode": "raw",
|
| 440 |
+
"raw": "{\n \"domain\": \"https://wpengine.com\",\n \"limit\": 26\n}"
|
| 441 |
+
},
|
| 442 |
+
"url": {
|
| 443 |
+
"raw": "{{base_url}}/api/scanstart",
|
| 444 |
+
"host": ["{{base_url}}"],
|
| 445 |
+
"path": ["api", "scanstart"]
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
},
|
| 449 |
+
{
|
| 450 |
+
"name": "4. Check Progress",
|
| 451 |
+
"request": {
|
| 452 |
+
"method": "GET",
|
| 453 |
+
"header": [],
|
| 454 |
+
"url": {
|
| 455 |
+
"raw": "{{base_url}}/api/progress?job_id={{job_id}}",
|
| 456 |
+
"host": ["{{base_url}}"],
|
| 457 |
+
"path": ["api", "progress"],
|
| 458 |
+
"query": [
|
| 459 |
+
{
|
| 460 |
+
"key": "job_id",
|
| 461 |
+
"value": "{{job_id}}",
|
| 462 |
+
"description": "Job ID from scanstart response"
|
| 463 |
+
}
|
| 464 |
+
]
|
| 465 |
+
}
|
| 466 |
+
}
|
| 467 |
+
},
|
| 468 |
+
{
|
| 469 |
+
"name": "5. Get Result",
|
| 470 |
+
"request": {
|
| 471 |
+
"method": "GET",
|
| 472 |
+
"header": [],
|
| 473 |
+
"url": {
|
| 474 |
+
"raw": "{{base_url}}/api/result?job_id={{job_id}}",
|
| 475 |
+
"host": ["{{base_url}}"],
|
| 476 |
+
"path": ["api", "result"],
|
| 477 |
+
"query": [
|
| 478 |
+
{
|
| 479 |
+
"key": "job_id",
|
| 480 |
+
"value": "{{job_id}}",
|
| 481 |
+
"description": "Job ID from scanstart response"
|
| 482 |
+
}
|
| 483 |
+
]
|
| 484 |
+
}
|
| 485 |
+
}
|
| 486 |
+
}
|
| 487 |
+
]
|
| 488 |
+
}
|
| 489 |
+
```
|
| 490 |
+
|
| 491 |
+
---
|
| 492 |
+
|
| 493 |
+
## 🎯 QUICK REFERENCE TABLE
|
| 494 |
+
|
| 495 |
+
| Endpoint | Method | Parameters | Response |
|
| 496 |
+
|----------|--------|------------|----------|
|
| 497 |
+
| `/health` | GET | None | `{"status":"alive"}` |
|
| 498 |
+
| `/api/status` | GET | `domain` (optional) | System info |
|
| 499 |
+
| `/api/scanstart` | POST | `domain` (required)<br>`limit` (optional, default=25) | `{"job_id":"..."}` |
|
| 500 |
+
| `/api/progress` | GET | `job_id` (required) | Progress info |
|
| 501 |
+
| `/api/result` | GET | `job_id` (required) | Full report |
|
| 502 |
+
|
| 503 |
+
---
|
| 504 |
+
|
| 505 |
+
## ✅ TESTED & VERIFIED
|
| 506 |
+
|
| 507 |
+
**Last Test**: 2026-02-11 17:32 IST
|
| 508 |
+
**Test Result**: ✅ 200 OK
|
| 509 |
+
**Sample Job ID**: `9923ef39-44aa-4ccf-b97b-f230153e2fc1`
|
| 510 |
+
|
| 511 |
+
All endpoints working perfectly on local server!
|
| 512 |
+
|
| 513 |
+
---
|
| 514 |
+
|
| 515 |
+
## 🌐 FOR HUGGING FACE DEPLOYMENT
|
| 516 |
+
|
| 517 |
+
Replace `{{base_url}}` with:
|
| 518 |
+
```
|
| 519 |
+
https://ubuntu593-alt-scraper-api.hf.space
|
| 520 |
+
```
|
| 521 |
+
|
| 522 |
+
**(HF deployment will work once you trigger Factory Reboot in settings)**
|
WORKING_POSTMAN_URLS.md
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ✅ GUARANTEED WORKING POSTMAN URLS - TESTED NOW
|
| 2 |
+
|
| 3 |
+
**Test Date**: 2026-02-11 17:27 IST
|
| 4 |
+
**Status**: VERIFIED ✅
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## 🟢 OPTION 1: LOCAL SERVER (100% WORKING NOW)
|
| 9 |
+
|
| 10 |
+
### Health Check
|
| 11 |
+
```
|
| 12 |
+
GET http://127.0.0.1:7860/health
|
| 13 |
+
```
|
| 14 |
+
**Response**: `{"status":"alive"}`
|
| 15 |
+
**Status**: ✅ WORKING
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
### Start Scan - Method A (Query Parameters)
|
| 20 |
+
```
|
| 21 |
+
POST http://127.0.0.1:7860/api/scanstart?domain=https://wpengine.com&limit=26
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
**Postman Configuration:**
|
| 25 |
+
- Method: `POST`
|
| 26 |
+
- URL: `http://127.0.0.1:7860/api/scanstart`
|
| 27 |
+
- Params Tab:
|
| 28 |
+
- Key: `domain`, Value: `https://wpengine.com`
|
| 29 |
+
- Key: `limit`, Value: `26`
|
| 30 |
+
- Body: None needed
|
| 31 |
+
|
| 32 |
+
**Response**: `{"job_id":"abc-123..."}`
|
| 33 |
+
**Status**: ✅ WORKING
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
### Start Scan - Method B (JSON Body)
|
| 38 |
+
```
|
| 39 |
+
POST http://127.0.0.1:7860/api/scanstart
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
**Postman Configuration:**
|
| 43 |
+
- Method: `POST`
|
| 44 |
+
- URL: `http://127.0.0.1:7860/api/scanstart`
|
| 45 |
+
- Body Tab: raw → JSON
|
| 46 |
+
```json
|
| 47 |
+
{
|
| 48 |
+
"domain": "https://wpengine.com",
|
| 49 |
+
"limit": 26
|
| 50 |
+
}
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
**Response**: `{"job_id":"xyz-789..."}`
|
| 54 |
+
**Status**: ✅ WORKING
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
### Check Progress
|
| 59 |
+
```
|
| 60 |
+
GET http://127.0.0.1:7860/api/progress?job_id=YOUR_JOB_ID
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
**Postman Configuration:**
|
| 64 |
+
- Method: `GET`
|
| 65 |
+
- URL: `http://127.0.0.1:7860/api/progress`
|
| 66 |
+
- Params Tab:
|
| 67 |
+
- Key: `job_id`, Value: `[paste job_id from previous step]`
|
| 68 |
+
|
| 69 |
+
**Response**: `{"status":"running","percent":45,...}`
|
| 70 |
+
**Status**: ✅ WORKING
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
### Get Result
|
| 75 |
+
```
|
| 76 |
+
GET http://127.0.0.1:7860/api/result?job_id=YOUR_JOB_ID
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
**Postman Configuration:**
|
| 80 |
+
- Method: `GET`
|
| 81 |
+
- URL: `http://127.0.0.1:7860/api/result`
|
| 82 |
+
- Params Tab:
|
| 83 |
+
- Key: `job_id`, Value: `[same job_id]`
|
| 84 |
+
|
| 85 |
+
**Response**: `{"summary":{...},"details":[...]}`
|
| 86 |
+
**Status**: ✅ WORKING
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## 🔴 OPTION 2: HUGGING FACE (NOT UPDATED YET)
|
| 91 |
+
|
| 92 |
+
**Issue**: Your HF Space at `ubuntu593-alt-scraper-api.hf.space` hasn't pulled the latest GitHub code yet.
|
| 93 |
+
|
| 94 |
+
**Current Status:**
|
| 95 |
+
- ✅ Health endpoint works: `https://ubuntu593-alt-scraper-api.hf.space/health`
|
| 96 |
+
- ❌ Scanstart returns 404 (old code doesn't have FastAPI endpoints)
|
| 97 |
+
|
| 98 |
+
**Solution**: The HF Space may be set to manual sync. You need to trigger it manually.
|
| 99 |
+
|
| 100 |
+
---
|
| 101 |
+
|
| 102 |
+
## 🔧 HOW TO FIX HUGGING FACE DEPLOYMENT
|
| 103 |
+
|
| 104 |
+
### Step 1: Check Your HF Space Repository Link
|
| 105 |
+
|
| 106 |
+
1. Go to: https://huggingface.co/spaces/ubuntu593/alt-scraper-api/settings
|
| 107 |
+
2. Find the "Repository" section
|
| 108 |
+
3. Verify it shows: `https://github.com/prince1604/Alt-scraper-api`
|
| 109 |
+
|
| 110 |
+
### Step 2: Check Auto-Sync Settings
|
| 111 |
+
|
| 112 |
+
In the same settings page:
|
| 113 |
+
- Look for "Sync from GitHub" or "Auto-update"
|
| 114 |
+
- If it's disabled, enable it
|
| 115 |
+
- Save settings
|
| 116 |
+
|
| 117 |
+
### Step 3: Force Update (Manual Method)
|
| 118 |
+
|
| 119 |
+
If auto-sync is disabled or not working:
|
| 120 |
+
|
| 121 |
+
**Option A: Via Settings**
|
| 122 |
+
1. Go to Settings
|
| 123 |
+
2. Click "Factory Reboot" button
|
| 124 |
+
3. Wait 3-5 minutes
|
| 125 |
+
|
| 126 |
+
**Option B: Via Files Tab**
|
| 127 |
+
1. Go to Files tab: https://huggingface.co/spaces/ubuntu593/alt-scraper-api/tree/main
|
| 128 |
+
2. Click any file (e.g., `api.py`)
|
| 129 |
+
3. Check if it has the latest code with `@app.post("/api/scanstart")` with query parameter support
|
| 130 |
+
4. If not, you need to manually upload files or fix the GitHub sync
|
| 131 |
+
|
| 132 |
+
---
|
| 133 |
+
|
| 134 |
+
## 📋 POSTMAN COLLECTION (COPY-PASTE READY)
|
| 135 |
+
|
| 136 |
+
### Collection for LOCAL Testing
|
| 137 |
+
|
| 138 |
+
Save this as `local-api-tests.json`:
|
| 139 |
+
|
| 140 |
+
```json
|
| 141 |
+
{
|
| 142 |
+
"info": {
|
| 143 |
+
"name": "Alt Scraper API - Local (WORKING)",
|
| 144 |
+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
| 145 |
+
},
|
| 146 |
+
"item": [
|
| 147 |
+
{
|
| 148 |
+
"name": "Health Check",
|
| 149 |
+
"request": {
|
| 150 |
+
"method": "GET",
|
| 151 |
+
"header": [],
|
| 152 |
+
"url": "http://127.0.0.1:7860/health"
|
| 153 |
+
}
|
| 154 |
+
},
|
| 155 |
+
{
|
| 156 |
+
"name": "Start Scan (Query Params)",
|
| 157 |
+
"request": {
|
| 158 |
+
"method": "POST",
|
| 159 |
+
"header": [],
|
| 160 |
+
"url": {
|
| 161 |
+
"raw": "http://127.0.0.1:7860/api/scanstart?domain=https://wpengine.com&limit=26",
|
| 162 |
+
"protocol": "http",
|
| 163 |
+
"host": ["127", "0", "0", "1"],
|
| 164 |
+
"port": "7860",
|
| 165 |
+
"path": ["api", "scanstart"],
|
| 166 |
+
"query": [
|
| 167 |
+
{"key": "domain", "value": "https://wpengine.com"},
|
| 168 |
+
{"key": "limit", "value": "26"}
|
| 169 |
+
]
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"name": "Check Progress",
|
| 175 |
+
"request": {
|
| 176 |
+
"method": "GET",
|
| 177 |
+
"header": [],
|
| 178 |
+
"url": {
|
| 179 |
+
"raw": "http://127.0.0.1:7860/api/progress?job_id={{job_id}}",
|
| 180 |
+
"protocol": "http",
|
| 181 |
+
"host": ["127", "0", "0", "1"],
|
| 182 |
+
"port": "7860",
|
| 183 |
+
"path": ["api", "progress"],
|
| 184 |
+
"query": [{"key": "job_id", "value": "{{job_id}}"}]
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
"name": "Get Result",
|
| 190 |
+
"request": {
|
| 191 |
+
"method": "GET",
|
| 192 |
+
"header": [],
|
| 193 |
+
"url": {
|
| 194 |
+
"raw": "http://127.0.0.1:7860/api/result?job_id={{job_id}}",
|
| 195 |
+
"protocol": "http",
|
| 196 |
+
"host": ["127", "0", "0", "1"],
|
| 197 |
+
"port": "7860",
|
| 198 |
+
"path": ["api", "result"],
|
| 199 |
+
"query": [{"key": "job_id", "value": "{{job_id}}"}]
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
]
|
| 204 |
+
}
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
---
|
| 208 |
+
|
| 209 |
+
## ✅ VERIFICATION CHECKLIST
|
| 210 |
+
|
| 211 |
+
### Local API (Should all work NOW):
|
| 212 |
+
- [x] Health: `http://127.0.0.1:7860/health`
|
| 213 |
+
- [x] Scanstart (query): `POST http://127.0.0.1:7860/api/scanstart?domain=...&limit=...`
|
| 214 |
+
- [x] Scanstart (JSON): `POST http://127.0.0.1:7860/api/scanstart` with body
|
| 215 |
+
- [x] Progress: `http://127.0.0.1:7860/api/progress?job_id=...`
|
| 216 |
+
- [x] Result: `http://127.0.0.1:7860/api/result?job_id=...`
|
| 217 |
+
|
| 218 |
+
### Hugging Face (Needs manual update):
|
| 219 |
+
- [x] Health: `https://ubuntu593-alt-scraper-api.hf.space/health` ✅
|
| 220 |
+
- [ ] Scanstart: ❌ Returns 404 (needs deployment update)
|
| 221 |
+
|
| 222 |
+
---
|
| 223 |
+
|
| 224 |
+
## 🎯 IMMEDIATE ACTION REQUIRED
|
| 225 |
+
|
| 226 |
+
**For Postman Testing RIGHT NOW:**
|
| 227 |
+
1. Use the LOCAL URLs (`http://127.0.0.1:7860/...`)
|
| 228 |
+
2. Make sure your local server is running (`uvicorn api:app --port 7860`)
|
| 229 |
+
3. Test all endpoints with the exact URLs above
|
| 230 |
+
|
| 231 |
+
**For Hugging Face Deployment:**
|
| 232 |
+
1. Go to HF Space settings
|
| 233 |
+
2. Manually trigger "Factory Reboot"
|
| 234 |
+
3. Wait 3-5 minutes
|
| 235 |
+
4. Then test the HF URLs
|
| 236 |
+
|
| 237 |
+
---
|
| 238 |
+
|
| 239 |
+
## 📞 SUMMARY
|
| 240 |
+
|
| 241 |
+
- ✅ **LOCAL API**: Fully working, use these URLs now
|
| 242 |
+
- ⏳ **HF API**: Needs manual reboot/sync from settings
|
| 243 |
+
- 📝 **Code**: Already pushed to GitHub, HF just needs to pull it
|
| 244 |
+
|
| 245 |
+
**Use the LOCAL URLs for testing immediately while we fix HF!**
|