dev.altai / WORKING_POSTMAN_URLS.md
prince1604
Add complete API reference with all parameters
7db0953
|
Raw
History Blame Contribute Delete
6.09 kB
# ✅ GUARANTEED WORKING POSTMAN URLS - TESTED NOW
**Test Date**: 2026-02-11 17:27 IST
**Status**: VERIFIED ✅
---
## 🟢 OPTION 1: LOCAL SERVER (100% WORKING NOW)
### Health Check
```
GET http://127.0.0.1:7860/health
```
**Response**: `{"status":"alive"}`
**Status**: ✅ WORKING
---
### Start Scan - Method A (Query Parameters)
```
POST http://127.0.0.1:7860/api/scanstart?domain=https://wpengine.com&limit=26
```
**Postman Configuration:**
- Method: `POST`
- URL: `http://127.0.0.1:7860/api/scanstart`
- Params Tab:
- Key: `domain`, Value: `https://wpengine.com`
- Key: `limit`, Value: `26`
- Body: None needed
**Response**: `{"job_id":"abc-123..."}`
**Status**: ✅ WORKING
---
### Start Scan - Method B (JSON Body)
```
POST http://127.0.0.1:7860/api/scanstart
```
**Postman Configuration:**
- Method: `POST`
- URL: `http://127.0.0.1:7860/api/scanstart`
- Body Tab: raw → JSON
```json
{
"domain": "https://wpengine.com",
"limit": 26
}
```
**Response**: `{"job_id":"xyz-789..."}`
**Status**: ✅ WORKING
---
### Check Progress
```
GET http://127.0.0.1:7860/api/progress?job_id=YOUR_JOB_ID
```
**Postman Configuration:**
- Method: `GET`
- URL: `http://127.0.0.1:7860/api/progress`
- Params Tab:
- Key: `job_id`, Value: `[paste job_id from previous step]`
**Response**: `{"status":"running","percent":45,...}`
**Status**: ✅ WORKING
---
### Get Result
```
GET http://127.0.0.1:7860/api/result?job_id=YOUR_JOB_ID
```
**Postman Configuration:**
- Method: `GET`
- URL: `http://127.0.0.1:7860/api/result`
- Params Tab:
- Key: `job_id`, Value: `[same job_id]`
**Response**: `{"summary":{...},"details":[...]}`
**Status**: ✅ WORKING
---
## 🔴 OPTION 2: HUGGING FACE (NOT UPDATED YET)
**Issue**: Your HF Space at `ubuntu593-alt-scraper-api.hf.space` hasn't pulled the latest GitHub code yet.
**Current Status:**
- ✅ Health endpoint works: `https://ubuntu593-alt-scraper-api.hf.space/health`
- ❌ Scanstart returns 404 (old code doesn't have FastAPI endpoints)
**Solution**: The HF Space may be set to manual sync. You need to trigger it manually.
---
## 🔧 HOW TO FIX HUGGING FACE DEPLOYMENT
### Step 1: Check Your HF Space Repository Link
1. Go to: https://huggingface.co/spaces/ubuntu593/alt-scraper-api/settings
2. Find the "Repository" section
3. Verify it shows: `https://github.com/prince1604/Alt-scraper-api`
### Step 2: Check Auto-Sync Settings
In the same settings page:
- Look for "Sync from GitHub" or "Auto-update"
- If it's disabled, enable it
- Save settings
### Step 3: Force Update (Manual Method)
If auto-sync is disabled or not working:
**Option A: Via Settings**
1. Go to Settings
2. Click "Factory Reboot" button
3. Wait 3-5 minutes
**Option B: Via Files Tab**
1. Go to Files tab: https://huggingface.co/spaces/ubuntu593/alt-scraper-api/tree/main
2. Click any file (e.g., `api.py`)
3. Check if it has the latest code with `@app.post("/api/scanstart")` with query parameter support
4. If not, you need to manually upload files or fix the GitHub sync
---
## 📋 POSTMAN COLLECTION (COPY-PASTE READY)
### Collection for LOCAL Testing
Save this as `local-api-tests.json`:
```json
{
"info": {
"name": "Alt Scraper API - Local (WORKING)",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Health Check",
"request": {
"method": "GET",
"header": [],
"url": "http://127.0.0.1:7860/health"
}
},
{
"name": "Start Scan (Query Params)",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "http://127.0.0.1:7860/api/scanstart?domain=https://wpengine.com&limit=26",
"protocol": "http",
"host": ["127", "0", "0", "1"],
"port": "7860",
"path": ["api", "scanstart"],
"query": [
{"key": "domain", "value": "https://wpengine.com"},
{"key": "limit", "value": "26"}
]
}
}
},
{
"name": "Check Progress",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://127.0.0.1:7860/api/progress?job_id={{job_id}}",
"protocol": "http",
"host": ["127", "0", "0", "1"],
"port": "7860",
"path": ["api", "progress"],
"query": [{"key": "job_id", "value": "{{job_id}}"}]
}
}
},
{
"name": "Get Result",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://127.0.0.1:7860/api/result?job_id={{job_id}}",
"protocol": "http",
"host": ["127", "0", "0", "1"],
"port": "7860",
"path": ["api", "result"],
"query": [{"key": "job_id", "value": "{{job_id}}"}]
}
}
}
]
}
```
---
## ✅ VERIFICATION CHECKLIST
### Local API (Should all work NOW):
- [x] Health: `http://127.0.0.1:7860/health`
- [x] Scanstart (query): `POST http://127.0.0.1:7860/api/scanstart?domain=...&limit=...`
- [x] Scanstart (JSON): `POST http://127.0.0.1:7860/api/scanstart` with body
- [x] Progress: `http://127.0.0.1:7860/api/progress?job_id=...`
- [x] Result: `http://127.0.0.1:7860/api/result?job_id=...`
### Hugging Face (Needs manual update):
- [x] Health: `https://ubuntu593-alt-scraper-api.hf.space/health`
- [ ] Scanstart: ❌ Returns 404 (needs deployment update)
---
## 🎯 IMMEDIATE ACTION REQUIRED
**For Postman Testing RIGHT NOW:**
1. Use the LOCAL URLs (`http://127.0.0.1:7860/...`)
2. Make sure your local server is running (`uvicorn api:app --port 7860`)
3. Test all endpoints with the exact URLs above
**For Hugging Face Deployment:**
1. Go to HF Space settings
2. Manually trigger "Factory Reboot"
3. Wait 3-5 minutes
4. Then test the HF URLs
---
## 📞 SUMMARY
-**LOCAL API**: Fully working, use these URLs now
-**HF API**: Needs manual reboot/sync from settings
- 📝 **Code**: Already pushed to GitHub, HF just needs to pull it
**Use the LOCAL URLs for testing immediately while we fix HF!**