# The `api/trace` Resource

> The `api/trace` resource returns a fragment of the trace file.

> ### For an overview see page eXtremeDB Web Service Resources

> To define the size and the location of the trace fragment, the following query arguments can be specified:

> - `count` - return the last `count` bytes from the trace file
> - `from` and, optionally, `to` - return the trace text starting with the `from` offset and up to the `to` offset, or to the end of the file if `to` is not specified

> The response is a JSON object which always contains the following keys:

> - `trace`: the trace text
> - `from`: starting offset of the fragment, relative to the beginning of the file
> - `to`: ending offset of the fragment, relative to the beginning of the file

> With the REST server started (listening on port 8083), the following http request will return the last 100 bytes from the trace file:

>         GET http://localhost:8083/api/trace?count=100

> The output returned would look like the following:

>         {
>             "trace":
>     "\/mcobject\/eXtremeDB_8.0\/eXtremeDB\/target\/xsql\/mcoxsql\/mcoxsql.cpp:2916-mcorest started at port 8083\n",
>             "from": 5051,
>             "to": 5151
>         }

> The following http request will return the bytes from offset `5051` to the end of the trace file:

>         GET http://localhost:8083/api/trace?from=5051

> The output returned would look like the following:

>         {
>             "trace":
>     "\/mcobject\/eXtremeDB_8.0\/eXtremeDB\/target\/xsql\/mcoxsql\/mcoxsql.cpp:2916-mcorest started at port 8083\n",
>             "from": 5051,
>             "to": 5151
>         }

> The following http request will return the bytes from offset `5051` to offset 5100 of the trace file:

>         GET http://localhost:8083/api/trace?from=5051&to=5100

> The output returned would look like the following:

>         {"\/mcobject\/eXtremeDB_8.0\/eXtremeDB\/target\/xsql\/mco",
>             ,
>             "from": 5051,
>             "to": 5100
>         }