JSON Filter API

Filter JSON data by status (current & upgraded) and save to file

API Usage

How to Use This API

This API fetches JSON data from a URL, filters items where status = "current" or "upgraded", and saves the results to a file.

GET Request: /api/filter?url=https://example.com/data.json
POST Request: POST /api/filter
Content-Type: application/json
{"url": "https://example.com/data.json"}

Test the API

Enter a URL that returns JSON data with objects containing a "status" field

Submit Base64 JSON

We will decode base64 on the server and filter items where newStatus/status is Current or Upgraded.

API Documentation

GET /api/filter?url=<json_url>

Fetch JSON data from URL and filter by status

curl "http://localhost:8000/api/filter?url=https://example.com/data.json"

POST /api/filter

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"}'

Expected JSON Format

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.