question

Upvotes
Accepted
89 2 6 9

query file size

How do I request file size information?

If I download a historical data file for example 290 gigabytes, need to be sure that the information is not lost.

tick-history-rest-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvote
Accepted
23k 22 9 14

Hello @s61670,

For me, the fundamental part of large extraction application design, both for on-demand and for scheduled large extractions, should be planning the extraction, we should be able to roughly estimate the size of the result, and if the result set for your targeted request is very large, breaking it up into reasonable-sized requests, ahead of time, makes sense.

If you are using scheduled extractions approach as described in:

REST API Tutorial 12: GUI control calls: immediate extract and .Net SDK Tutorial 3: GUI control calls: Lists, Reports, Schedules

You can take advantage of:

{ {protocol}}{ {host}}{ {api}}Extractions/ReportExtractions('{ {reportExtractionId}}')/Files

For example:

{
            "ExtractedFileId": "VjF8fDgwMDgwNTgxMw",
            "ReportExtractionId": "2000000234343447",
            "ScheduleId": "0x0749e7fff5a6f86b",
            "FileType": "Note",
            "ExtractedFileName": "19945.myNonImmediateSchedule.20210329.160008.2000000234343447.x07q25.csv.notes.txt",
            "LastWriteTimeUtc": "2021-03-29T16:00:08.957Z",
            "ContentsExists": true,
            "Size": 1711,
            "ReceivedDateUtc": "2021-03-29T16:00:08.957Z"
        }

Once we have downloaded the file, if you have direct access to the headers, you can examine content-length in it's header, for example:

When working with large result sets, following Tick History Best Practices is especially important.


contentlength.gif (18.8 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea