File size: 3,906 Bytes
fc24f5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Postman Collection - Hugging Face Deployment
**Base URL**: `https://ubuntu593-alt-scraper-api.hf.space`

---

## 1️⃣ Health Check
**Simple uptime check**

- **Method**: `GET`
- **URL**: `https://ubuntu593-alt-scraper-api.hf.space/health`
- **Expected Response**:
```json
{
  "status": "alive"
}
```

---

## 2️⃣ System Status
**Check server region, latency, and domain connectivity**

- **Method**: `GET`
- **URL**: `https://ubuntu593-alt-scraper-api.hf.space/api/status?domain=https://wpengine.com/`
- **Parameters**:
  - `domain` (optional): Target domain to test connectivity
- **Expected Response**:
```json
{
  "region": "Frankfurt, DE",
  "latency": 45,
  "status": "operational",
  "engine": "AutoAlt Neural v2"
}
```

---

## 3️⃣ Start a New Scan
**Initiate async crawl job**

- **Method**: `POST`
- **URL**: `https://ubuntu593-alt-scraper-api.hf.space/api/scanstart`
- **Headers**: 
  - `Content-Type: application/json`
- **Body** (raw JSON):
```json
{
  "domain": "https://wpengine.com/",
  "limit": 25
}
```
- **Expected Response**:
```json
{
  "job_id": "abc123-def456-..."
}
```
**⚠️ Save this `job_id` for the next steps!**

---

## 4️⃣ Check Scan Progress
**Poll for real-time updates**

### Option A: Path Parameter
- **Method**: `GET`
- **URL**: `https://ubuntu593-alt-scraper-api.hf.space/api/progress/{job_id}`
  - Replace `{job_id}` with the actual ID from step 3

### Option B: Query Parameter (Easier for browser testing)
- **Method**: `GET`
- **URL**: `https://ubuntu593-alt-scraper-api.hf.space/api/progress?job_id=YOUR_JOB_ID_HERE`

**Expected Response**:
```json
{
  "status": "running",
  "percent": 60,
  "pages_scanned": 15,
  "images_found": 87,
  "message": "Scanning: https://wpengine.com/about",
  "elapsed_seconds": 12,
  "eta_seconds": 8,
  "error": null
}
```

**Status Values**: `pending`, `running`, `done`, `error`

---

## 5️⃣ Get Final Results
**Retrieve complete JSON report (once status is `done`)**

### Option A: Path Parameter
- **Method**: `GET`
- **URL**: `https://ubuntu593-alt-scraper-api.hf.space/api/result/{job_id}`

### Option B: Query Parameter
- **Method**: `GET`
- **URL**: `https://ubuntu593-alt-scraper-api.hf.space/api/result?job_id=YOUR_JOB_ID_HERE`

**Expected Response**:
```json
{
  "summary": {
    "total_pages_scanned": 25,
    "total_images_found": 145,
    "total_images_missing_alt": 23,
    "total_images_poor_quality": 5,
    "total_pages_discovered": 50,
    "blocked_reason": null,
    "crawl_blocked": false
  },
  "details": [ ... ]
}
```

---

## 🧪 Complete Test Flow (Copy to Postman)

### Test 1: Health Check
```bash
curl https://ubuntu593-alt-scraper-api.hf.space/health
```

### Test 2: System Status
```bash
curl "https://ubuntu593-alt-scraper-api.hf.space/api/status?domain=https://wpengine.com/"
```

### Test 3: Start Scan
```bash
curl -X POST "https://ubuntu593-alt-scraper-api.hf.space/api/scanstart" \
  -H "Content-Type: application/json" \
  -d '{"domain": "https://wpengine.com/", "limit": 25}'
```

### Test 4: Progress (use job_id from Test 3)
```bash
curl "https://ubuntu593-alt-scraper-api.hf.space/api/progress?job_id=PASTE_JOB_ID"
```

### Test 5: Result (when status = done)
```bash
curl "https://ubuntu593-alt-scraper-api.hf.space/api/result?job_id=PASTE_JOB_ID"
```

---

## ⚠️ Common Mistakes to Avoid

1. **Don't use `limit` parameter on `/api/status`** ❌
   - ❌ Wrong: `/api/status?domain=...&limit=25`
   - ✅ Right: `/api/status?domain=...`

2. **Use POST (not GET) for `/api/scanstart`** ❌
   - ❌ Wrong: GET request
   - ✅ Right: POST with JSON body

3. **Don't forget to URL-encode the domain parameter** ⚠️
   - If testing in browser, use `https%3A%2F%2Fwpengine.com%2F`
   - Postman/curl handle this automatically

---

## 🎯 Quick Postman Import

Create a new Postman collection and add these 5 requests with the URLs above. Test them in order!