{
  "info": {
    "name": "ProphetAI API",
    "description": "User collection for the ProphetAI public API.\n\nSetup:\n1. In Postman, go to Variables tab and set `api_key` to the key you were given.\n2. Optionally change `base_url` if you have a custom deployment.\n3. Run any request — authentication is handled automatically.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://prophetai.club",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "",
      "type": "string",
      "description": "Your ProphetAI API key (pk_live_...)"
    }
  ],
  "item": [
    {
      "name": "Bets",
      "item": [
        {
          "name": "Get Bet History",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 200', function() {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "pm.test('Has data array', function() {",
                  "    var json = pm.response.json();",
                  "    pm.expect(json.data).to.be.an('array');",
                  "    pm.expect(json.count).to.be.a('number');",
                  "});",
                  "pm.test('Rate limit headers present', function() {",
                  "    pm.response.to.have.header('X-RateLimit-Limit');",
                  "    pm.response.to.have.header('X-RateLimit-Remaining');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              { "key": "x-api-key", "value": "{{api_key}}" }
            ],
            "url": {
              "raw": "{{base_url}}/api/bets/history?start_utc=2026-01-01T00:00:00Z&end_utc=2026-12-31T23:59:59Z",
              "host": ["{{base_url}}"],
              "path": ["api", "bets", "history"],
              "query": [
                { "key": "start_utc", "value": "2026-01-01T00:00:00Z", "description": "Start of UTC date range (ISO 8601)" },
                { "key": "end_utc", "value": "2026-12-31T23:59:59Z", "description": "End of UTC date range (ISO 8601)" }
              ]
            },
            "description": "Returns all settled and open bets whose event_date falls within the specified UTC range.\n\nRequired parameters:\n- `start_utc` — ISO 8601 UTC timestamp (must end with Z or +00:00)\n- `end_utc` — ISO 8601 UTC timestamp"
          }
        },
        {
          "name": "Get Bet History (Last 7 Days)",
          "request": {
            "method": "GET",
            "header": [
              { "key": "x-api-key", "value": "{{api_key}}" }
            ],
            "url": {
              "raw": "{{base_url}}/api/bets/history?start_utc=2026-04-26T00:00:00Z&end_utc=2026-05-03T23:59:59Z",
              "host": ["{{base_url}}"],
              "path": ["api", "bets", "history"],
              "query": [
                { "key": "start_utc", "value": "2026-04-26T00:00:00Z" },
                { "key": "end_utc", "value": "2026-05-03T23:59:59Z" }
              ]
            },
            "description": "Example: last 7 days of bet history. Adjust dates as needed."
          }
        }
      ]
    },
    {
      "name": "Tips",
      "item": [
        {
          "name": "Get All Tips",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test('Status is 200', function() {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "pm.test('Has data array', function() {",
                  "    var json = pm.response.json();",
                  "    pm.expect(json.data).to.be.an('array');",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [
              { "key": "x-api-key", "value": "{{api_key}}" }
            ],
            "url": {
              "raw": "{{base_url}}/api/tips",
              "host": ["{{base_url}}"],
              "path": ["api", "tips"]
            },
            "description": "Fetch all tips. All query params are optional."
          }
        },
        {
          "name": "Get Tips (by sport)",
          "request": {
            "method": "GET",
            "header": [
              { "key": "x-api-key", "value": "{{api_key}}" }
            ],
            "url": {
              "raw": "{{base_url}}/api/tips?sport=football",
              "host": ["{{base_url}}"],
              "path": ["api", "tips"],
              "query": [
                { "key": "sport", "value": "football", "description": "Filter by sport (case-insensitive)" }
              ]
            },
            "description": "Fetch tips filtered by sport name."
          }
        },
        {
          "name": "Get Tips (by status)",
          "request": {
            "method": "GET",
            "header": [
              { "key": "x-api-key", "value": "{{api_key}}" }
            ],
            "url": {
              "raw": "{{base_url}}/api/tips?status=open",
              "host": ["{{base_url}}"],
              "path": ["api", "tips"],
              "query": [
                { "key": "status", "value": "open", "description": "Filter by status: open, won, lost, void, push" }
              ]
            },
            "description": "Fetch tips filtered by settlement status."
          }
        },
        {
          "name": "Get Tips (by date range)",
          "request": {
            "method": "GET",
            "header": [
              { "key": "x-api-key", "value": "{{api_key}}" }
            ],
            "url": {
              "raw": "{{base_url}}/api/tips?start_utc=2026-01-01T00:00:00Z&end_utc=2026-12-31T23:59:59Z",
              "host": ["{{base_url}}"],
              "path": ["api", "tips"],
              "query": [
                { "key": "start_utc", "value": "2026-01-01T00:00:00Z" },
                { "key": "end_utc", "value": "2026-12-31T23:59:59Z" }
              ]
            },
            "description": "Fetch tips whose event_date falls within a UTC range."
          }
        },
        {
          "name": "Get Tips (combined filters)",
          "request": {
            "method": "GET",
            "header": [
              { "key": "x-api-key", "value": "{{api_key}}" }
            ],
            "url": {
              "raw": "{{base_url}}/api/tips?sport=tennis&status=won&start_utc=2026-01-01T00:00:00Z&end_utc=2026-12-31T23:59:59Z",
              "host": ["{{base_url}}"],
              "path": ["api", "tips"],
              "query": [
                { "key": "sport", "value": "tennis" },
                { "key": "status", "value": "won" },
                { "key": "start_utc", "value": "2026-01-01T00:00:00Z" },
                { "key": "end_utc", "value": "2026-12-31T23:59:59Z" }
              ]
            },
            "description": "Example with all three filters applied simultaneously."
          }
        }
      ]
    }
  ]
}
