How to filter different values when using HTTP API

When I used the PromQL, I can write some QL like this :
container_task_status{} > 0
I want to know how to express the same when using HTTP API

  1. Prometheus provides a time sequence, but sometimes I just want to know the first timestamp which an event appear, and the last timestamp this event disappear, such as when I query
    I just want to know the first timestamp that Prometheus has seen this event and the last timestamp that Prometheus seed the timestamp, how to use the HTTP API to solve this problem.

If you can answer my question or give instructions to the solutions, I’d appreciate it very much