How does $__unixEpochFilter translate into MySQL query?

We have a Grafana instance that is currently connected to MySQL data source, this query is being executed

  time AS "time",
  videoid AS "metric",
  sum(mbytes) AS "mbytes",
  CONCAT(`video_url`, '', videoid)  AS url,
  video_title as title
FROM topvideos
GROUP BY videoid,2

We want to transition from a MySQL data source to a rest API data source via the infinity plugin.

Therefore we would want Grafana to be able to call our API and send it a start and an end time. We have two questions:

  1. How does __unixEpochFilter translate into a MySQL query? Where time between a and b?

  2. How to get a start and end time to send it in an API call? Do I have access to them as variables I can use or do I only have access to __unixEpochFilter?