Filter JSON data by status (current & upgraded) and save to file
This API fetches JSON data from a URL, filters items where status = "current" or "upgraded", and saves the results to a file.
/api/filter?url=https://example.com/data.json
POST /api/filter
Content-Type: application/json
{"url": "https://example.com/data.json"}
Fetch JSON data from URL and filter by status
curl "http://localhost:8000/api/filter?url=https://example.com/data.json"
Send JSON URL in request body
curl -X POST http://localhost:8000/api/filter \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/data.json"}'
Or send base64-encoded JSON:
curl -X POST http://localhost:8000/api/filter \
-H "Content-Type: application/json" \
-d '{"data_base64": "BASE64_STRING_HERE"}'
The API expects JSON data with objects containing a "status" field:
[
{"id": 1, "name": "Item 1", "status": "current"},
{"id": 2, "name": "Item 2", "status": "upgraded"},
{"id": 3, "name": "Item 3", "status": "discontinued"}
]
Only items with status "current" or "upgraded" will be included in the filtered result.