Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter Twenty-oneEDGARView Integration (continued)

EDGARFetchArchiveList Function

Overview

The EDGARFetchArchiveList function queries the EDGAR Archive and reads a list of files or filing from the public website.

Syntax/Parameters

Syntax

string [] = EDGARFetchArchiveList ( string CIK | qword CIK, [boolean exclude],
                                                        [int count | string date],
                                                        [string prior],
                                                        [boolean piq_flag );

Parameters

CIK

A string or a qword that specifies the registrant CIK to retrieve. Note that EDGAR CIK values can exceed a 32-bit integer size.

exclude

An optional boolean value to exclude section 16 filings (Forms 3/4/5 and amendments). The default value is FALSE.

count

An optional int value specifying a limit on the count of items to fetch. Or,

date

An optional string value specifying the oldest item to fetch. The string must be in the format YYYY-MM-DD with no spaces and zero filled.

prior

An optional string value specifying the date to fetch from. The string must be in the format YYYYMMDD with no other characters and zero filled. To use this parameter without count or date parameters, set that parameter position to 0 or "".

piq_flag

An optional boolean specifying to perform an incremental query. When set, and not restricting parameters are present, the fetch will moved from loading the maximum records on each query to an include month-by-month query. See Remarks below.

Return Value

A string array containing full URLs of all matching files. On error, the list will be empty. Use the GetLastError function to retrieve error details. If the CIK does not exist, ERROR_REMOTE (0x88000000) with ERROR_FILE_NOT_FOUND (2) will be returned.

Some parameters are checked prior to running the query to the SEC, these will set the error code to ERROR_SYNTAX with the parameter number in the low word of the error code.

The last error can also be set to ERROR_OVERFLOW if there are items in the list than the SEC’s site will return. However, the list will contain items with the error set.

Remarks

This function “scrapes” the SEC’s public side EDGAR Archive and returns a listing of matching filing for a specific CIK. Only PDS archive files are returned as “nnnnnnnnnn-nn-nnnnnn.txt” with the archive URL prefix.

The accession links are returned latest to oldest until the end of the list is reached, the count is met or the date of the filing is older than specified. Note that the accession entries are returned as reported by the SEC archive. Any inconsistencies are as reported by the SEC’s EDGAR archive website.

In many cases, section 16 links will significantly expand the number of downloaded links. Setting the exclude parameter to TRUE will exclude all Section 16 filings.

Note that the EDGAR archive will only enumerate 2000 filings per query. Using the exclude function will allow for more non-Section 16 filings. The piq_flag parameter forces a month-by-month query, if and only if, a date, count or prior filters has not been applied. The prior parameter can be used to segment the filing retrieval. Check the last error for ERROR_OVERFLOW to determine if the parameters should be narrowed.

Incremental query is significantly slower than the standard query. It is suggested that the standard query be performed and then move to the incremental query if an ERROR_OVERFLOW is required.

Note that depending on the connection and number of filings, this function can take a number of seconds (or longer) or complete. Use the count or date to limit the total pages scraped. If a progress window is open within the script, the EDGARFetchArchiveList will update the second status line with download information.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic