Q4Widgets API Documentation

q4.sec

Fetches and displays SEC filings from the Q4 private API.

Latest Version Update: 1.13.4
- Updated sec functionality.
- Added option to filter by filing type (filingTypes).
- Renamed previous filingTypes array to filingGroups.
- Updated Documentation.

Below is an example of an SEC widget with form type filtering.
- It uses the yearSelect and yearTemplate to render a dropdown list of years.
- This widget uses the beforeRenderItems callback to allow the user to redefine custom docTypes based on the filing docType. This is used to simplify icon styling.
- This widget also uses the complete callback to trigger additional widget filtering options.
- One can set a widget option, such as filtering by filingGroups, by defining the new option when the user changes the dropdown.
- After setting new options, calling the reloadItems method will reload the content inside itemContainer based on the new widget options.

Script link
q4.api.1.13.6.min.js
Source file
q4.api.js, line 2307

This widget extends the q4.api widget. It has all the options and methods of the parent widget, in addition to those below. See the parent widget's documentation for details.

Examples

<div class="module_options">
    <label class="module_options-label" for="SecYearSelect">Select year:</label>
    <select class="dropdown module_options-select module-sec_year-select" id="SecYearSelect"></select>
    <label class="module_options-label" for="SecFilingType">Filter filing type:</label>
    <select class="dropdown module_options-select module-sec_type-select" id="SecFilingType">
        <option selected="selected" value="">All Form Types</option>
        <option value="1,4">Annual Filings</option>
        <option value="2">Quarterly Filings</option>
        <option value="9,40">Current Reports</option>
        <option value="11,17">Proxy Filings</option>
        <option value="41">Registration Statements</option>
        <option value="13">Section 16 Filings</option>
        <option value="3,20,21,30,33,34,35,36,37,42">Other</option>
    </select>
</div>
<div class="module_header grid--no-gutter">
    <span class="module_header-text module-sec_date grid_col grid_col--2-of-12 grid_col--md-1-of-1">Date</span>
    <span class="module_header-text module-sec_filing grid_col grid_col--2-of-12 grid_col--md-1-of-1">Filing Type</span>
    <span class="module_header-text module-sec_description grid_col grid_col--5-of-12 grid_col--md-1-of-1">Filing Description</span>
    <span class="module_header-text module-sec_download-item grid_col grid_col--3-of-12 grid_col--md-1-of-1">Download / View</span>
</div>
<div class="module_container module_container--content grid--no-gutter grid--no-space"></div>

<script>
$('.module-sec--widget .module_container--inner').sec({
    exchange: 'CIK',
    symbol: '000000000', // replace with client's CIK number
    excludeNoDocuments: true,
    dateFormat: 'MM dd, yy',
    itemLoadingMessage: '<p class="module_loader"><i class="q4-icon_spinner"></i><span class="sr-only">Loading items...</span></p>',
    itemNotFoundMessage: '<p><i class="q4-icon_warning-line"></i> There are no items matching your query.</p>',
    yearSelect: '.module-sec_year-select',
    yearContainer: '.module-sec_year-select',
    yearTemplate: '<option value="{{value}}">{{year}}</option>',
    itemContainer: '.module_container--content',
    itemTemplate: (
        '<div class="module_item">' +
            '<div class="module-sec_date grid_col grid_col--2-of-12 grid_col--md-1-of-1">' +
                '<span class="module-sec_date-text">{{date}}</span>' +
            '</div>' +
            '<div class="module-sec_filing grid_col grid_col--2-of-12 grid_col--md-1-of-1">' +
                '<span class="sr-only">Form</span>' +
                '<a class="module-sec_filing-link" href="{{url}}">{{type}}</a>' +
            '</div>' +
            '<div class="module-sec_description grid_col grid_col--5-of-12 grid_col--md-1-of-1">' +
                '<span class="module-sec_description-text">{{description}}</span>' +
            '</div>' +
            '<ul class="module-sec_download-list module_q4-icon-links grid_col grid_col--3-of-12 grid_col--md-1-of-1">' +
                '{{#docs}}' +
                    '{{#docUrl}}<li class="module-sec_download-list-item module-sec_{{docType}}">' +
                        '<a class="module_link module_link-sec" href="{{docUrl}}" target="_blank">' +
                            '<span class="sr-only">{{docType}} Format Download (opens in new window)</span>' +
                        '</a>' +
                    '</li>{{/docUrl}}' +
                '{{/docs}}' +
            '</ul>' +
        '</div>'
    ),
    itemLoadingMessage: '<p class="module_loader"><i class="q4-icon_spinner"></i><span class="sr-only">Loading items...</span></p>',
    beforeRenderItems: function(event, data) {
        $.each(data.items, function(i, item) {
            $.each(item.docs, function(idx, doc) {
                switch (doc.docType) {
                    case 'CONVPDF':
                        doc.docType = 'pdf'
                        break;
                    case 'RTF':
                    case 'CONVTEXT':
                        doc.docType = 'word'
                        break;
                    case 'XLS':
                        doc.docType = 'excel'
                        break;
                    case 'HTML':
                    case 'XBRL_HTML':
                        doc.docType = 'html'
                        break;
                    case 'XBRL':
                        doc.docType = 'zip'
                }
            });
        });
    },
    complete: function(e) {
        var $widget = $(this);
        $widget.find('.module-sec_type-select').on('change', function() {
            var types = $(this).val().split(',');
            $widget.sec('option', 'filingGroups', types);
            $widget.sec('reloadItems');
        });
    }

});
</script>

Options

exchange string
The exchange of the stock symbol to look up. If you are looking up the company by CIK, enter 'CIK'.
symbol string
The stock symbol to look up. If you are looking up the company by CIK, enter the CIK number here.
filingTypes Array.<string>
An array of filing types to filter by, or an empty list to skip filtering.
Example
["8-K","10-K"]
filingGroups Array.<number>
An array of numeric filing type groups to filter by, or an empty list to skip filtering.
docOrder Array.<string>
An array of document types to sort their order.
Default value
["CONVPDF","RTF","XLS","XBRL","XBRL_HTML","HTML","CONVTEXT","ORIG"]
excludeNoDocuments boolean
Whether to exclude filings that have no associated documents.
Default value
false
includeHtmlDocument boolean
Toggle whether to include html versions of files (if available from Edgar Online).
Default value
false
template string
  • All the notes documented in the q4.api parent widget are applicable here.
  • This widget supports template, itemTemplate and yearTemplate options.
The template or itemTemplate may contain the following mustache variables:
  • {{description}} - The title/filing description. This text can be truncated with the titleLength option.
  • {{url}} - The URL of the SEC filing details page.
  • {{id}} - The filing ID for the SEC filing
  • {{date}} - The date of the SEC filing item.
  • {{year}} - The year of the filing item (pulled from filing date).
  • {{agent}} - The name of the filing agent.
  • {{person}} - The name of the reporting agent.
  • {{type}} - The form type of the filing (Mnemonic)
  • {{#docs}} - An array of documents for the filing. Inner variables for each document are:
    • {{docUrl}} - The URL of the document
    • {{docType}} - The file type for the document (ex. PDF). If online document category, value will be null