

# EDGARquery

# all submissions for a CIK
# all submissions for a CIK including mutual funds
https://data.sec.gov/submissions/CIK0001018724.json

# top mutual funds
# https://www.barrons.com/articles/barrons-best-fund-families-of-2023-28d337b2
# https://www.swfinstitute.org/fund-manager-rankings

# https://www.sec.gov/edgar/browse/?CIK=0000036405 e.g. vanguard
# 497K submission for a mutual fund
https://www.sec.gov/Archives/edgar/data/36405/
https://www.sec.gov/Archives/edgar/data/736054
https://www.sec.gov/Archives/edgar/data/736054/000168386324004645
# N-CSR N-CSRS
# N-CSR N-CSRS  in the submissions json file
# filing data list for mutual funds identified by series id
# and class id investor shares admiral shares etf institutional
# CID for series begins with S
# CID for class begins with C
https://www.sec.gov/Archives/edgar/data/736054/000168386324004645/0001683863-24-004645-index.html
# vanguard 500 fund admiral shares
https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=C000007774
# vanguard 500 fund admiral shares holdings
https://www.sec.gov/Archives/edgar/data/36405/000175272424126393/vg_500index.htm
https://www.sec.gov/Archives/edgar/data/36405/000175272424126393/primary_doc.xml

https://www.sec.gov/Archives/edgar/data/736054/000168386324004645/0001683863-24-004645-index.html

# https://www.sec.gov/Archives/edgar/data//819118 e.g fidelity
https://www.sec.gov/edgar/browse/?CIK=0000819118
https://www.sec.gov/Archives/edgar/data/819118/000074482224000050
https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=S000006027
https://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=C000100045

- [sources of information]

  # Note: only a few fact names are returned by EDGAR for a CY
  #       it seems that only I type CYs are returned
  # for a list of company concepts, first retrieve the company facts
  # file for a CIK and search the json file

  # from SEC

  # SEC contact information
  https://www.sec.gov/contact-information/sec-directory

  # SEC data resources
  https://www.sec.gov/sec-data-resources

  # SEC webmaster FAQ
  https://www.sec.gov/os/webmaster-faq

  # contains some generalaccess instructions
  #     User-Agent rule
  #     contains urls for daily index and for full index
  #     shows some directory structure
  #     describes format for accession numbers CIK-YY-f#
  #     describes web browsing by CIK or accession number
  #     has links to risk analysis data
  https://www.sec.gov/os/accessing-edgar-data
  #     query by CIK and accession number
  https://www.sec.gov/Archives/edgar/data/$CIK/

  # RESTFUL API documentation
  # Currently included in the APIs are the submissions history by filer
  # and the XBRL data from financial statements
  # (forms 10-Q, 10-K,8-K, 20-F, 40-F, 6-K, and their variants).
  # how to read a 10-K/10-Q
  # https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins/how-read
  # In addition, a bulk ZIP file is available to download all JSON structures
  # for an API.
  # This ZIP file is updated and republished nightly at approximately
  # 3:00 a.m. ET.
  https://www.sec.gov/edgar/sec-api-documentation

  https://www.sec.gov/edgar/searchedgar/cik
  example page for amazon com inc
  https://www.sec.gov/edgar/browse/?CIK=1018724
  example page for tesla motors inc
  https://www.sec.gov/edgar/browse/?CIK=1318605
  example page for nvidia corp
  https://www.sec.gov/edgar/browse/?CIK=1045810
  example page for american vanguard corp 10-K
  https://www.sec.gov/edgar/search/#/dateRange=custom&category=custom&ciks=0000005981&entityName=AMERICAN%2520VANGUARD%2520CORP%2520(AVD)%2520(CIK%25200000005981)&startdt=2023-01-01&enddt=2024-01-20&forms=10-K
  example warren buffett
  https://www.sec.gov/edgar/search/#/ciks=0000315090&entityName=BUFFETT%2520WARREN%2520E%2520(CIK%25200000315090)

  # contains some access instructions
  #    contains urls to company search, latest filings search
  #    contains this example:
  #    https://www.sec.gov/cgi-bin/browse-edgar?
  #        action=getcurrent&type=10-k&company=&dateb=&owner=include&
  #        start=0&count=40&output=atom
  #    daily archives
  #       tar.gz files for each filing day - by year
  #    Oldloads
  #        daily concatenated gzipped archive files for filings - by year
  https://www.sec.gov/developer

  # contains html page for indices for each year
  #     sitemap.xml contains xml urls for each quarter
  # companyfacts.zip many json files combining facts and xbrlframes
  # submissions.zip many json files containing filings with accession numbers
  https://www.sec.gov/Archives/edgar/daily-index/

  # contains urls to quarterly index xml files
  # each quarterly index contains urls to filings
  https://www.sec.gov/Archives/edgar/daily-index/sitemap.xml

  # conatains monthly data xbrlrss-YYYY-MM.xml
  # filings for the month 10-K 10-Q etc
  https://www.sec.gov/Archives/edgar/monthly/

  # contains html page for indices each year
  #    files in gz, idx, Z, zip formats
  #    company.zip form.zip master.zip xbrl.zip
  # company.zip filename, form, cik  space aligned
  # form.zip form name date filename cik  space aligned
  # master.zip CIK|Company Name|Form Type|Date Filed|Filename
  # xbrl.zip CIK|Company Name|Form Type|Date Filed|Filename
  # contains directories from 1993 to current year
  # each year contains directories for QTR[1-7]
  # each quarter has company.zip form.zip master.zip xbrl.zip
  # e.g.
  # 2023/QTR1/form[gz,idx,Z,zip]
  https://www.sec.gov/Archives/edgar/full-index/

  # contains company crawler form master xbrl files
  # contains urls to quarterly indexes
  #    seems to go from 1993 to 2012
  #    quarterly indexes contain paths to indices for each quarter
  #    quarterly index for a quarter contain paths to filing html pages
  https://www.sec.gov/Archives/edgar/full-index/sitemap.quarterlyindexes.xml

  # paths to sec filings - change .txt to -index.htm
  # Novavax 8-K
  # e.g edgar/data/1000694/0001104659-24-002100.txt
  # becomed https://www.sec.gov/Archives/edgar/data/1000694/0001104659-24-002100-index.htm
  https://www.sec.gov/Archives/edgar/full-index/xbrl.zip

  # pdf files of some filings submitted as paper
  https://www.sec.gov/Archives/edgar/vprr/index.html

  # search company, ticker, cik, or person
  # returns a page to links to filings
  # how to use the companysearch page
  # https://www.sec.gov/filings/edgar-guide
  https://www.sec.gov/edgar/searchedgar/companysearch

  # company ticker files in json format
  https://www.sec.gov/files/company_tickers.json          companies
  https://www.sec.gov/files/company_tickers_exchange.json by exchange
  https://www.sec.gov/files/company_tickers_mf.json       mutual funds

  # filings guidance mutual fund ETF annuity
  # forms 10-K 10-Q 8-K
  # proxy statements PRE 14A, DEF 14A
  https://www.sec.gov/filings/edgar-guide
  # insider trading forms 3, 4, 5
  https://www.sec.gov/data
  https://www.sec.gov/structureddata/announcement/osd-announcement-081222-form-345-data-sets
  https://www.investor.gov/introduction-investing/general-resources/news-alerts/alerts-bulletins/investor-bulletins-69
  # beneficial ownership >5% voting securities SC 13[DG], DEF 14A, 13F-HR
  # business combinations
  # public offerings
  # securities based crowd funding
  # regulation A offering
  # etc

  # news apis
  https://developer.nytimes.com/apis
  https://pypi.org/project/GoogleNews/
      https://github.com/Iceloof/GoogleNews

  https://developers.google.com/apis-explorer
  https://news.google.com/rss?hl=en-US&gl=US&ceid=US:en
  https://news.google.com/atom?hl=en-US&gl=US&ceid=US:en
  https://www.aakashweb.com/articles/google-news-rss-feed-url/
  https://developers.google.com/gdata/docs/1.0/reference obsolete
  https://developers.google.com/identity

  stock price data
  https://www.marketwatch.com/market-data
  1 month
  https://www.marketwatch.com/investing/stock/amzn/downloaddatapartial?
      startdate=11/17/2023%2000:00:00&enddate=02/15/2024%2000:00:00&
      daterange=d30&frequency=p1d&csvdownload=true&downloadpartial=false&
      newdates=false
  https://www.marketwatch.com/investing/stock/lly/downloaddatapartial?
      startdate=11/17/2023%2000:00:00&enddate=02/15/2024%2000:00:00&
      daterange=d30&frequency=p1d&csvdownload=true&downloadpartial=false&
      newdates=false
  1 year
  https://www.marketwatch.com/investing/stock/amzn/downloaddatapartial?
      startdate=02/15/2023%2000:00:00&enddate=02/15/2024%2000:00:00&
      daterange=d30&frequency=p1d&csvdownload=true&downloadpartial=false&
      newdates=false
  https://www.marketwatch.com/investing/stock/lly/downloaddatapartial?
      startdate=02/15/2023%2000:00:00&enddate=02/15/2024%2000:00:00&
      daterange=d30&frequency=p1d&csvdownload=true&downloadpartial=false&
      newdates=false
  https://stooq.com
  https://stooq.com/q/?s=nvda.us
  https://stooq.com/q/d/?s=amzn.us
  https://stooq.com/q/d/l/?s=amzn.us&i=d
  https://stooq.com/q/d/l/?s=nvda.us&i=d
  max history
  https://stooq.com/q/d/l/?s=jpm.us&i=d
  https://stooq.com/q/d/l/?s=nvda.us&i=d
  https://stooq.com/q/d/l/?s=amzn.us&i=d
  https://stooq.com/q/d/l/?s=meta.us&i=d
  1 year?
  https://stooq.com/q/l/?s=goog.us&f=sd2t2ohlcv&h&e=csv
  https://stooq.com/q/l/?s=meta.us&f=sd2t2ohlcv&h&e=csv
  https://stooq.com/q/l/?s=amzn.us&f=sd2t2ohlcv&h&e=csv
  https://www.investopedia.com/ask/answers/find-historical-stock-index-quotes/
  https://www.macrotrends.net/stocks/research
  https://www.macrotrends.net/stocks/charts/NVDA/nvidia/stock-price-history
  https://www.nasdaq.com/market-activity/quotes/historical
  https://www.nasdaq.com/market-activity/stocks/nvda/historical
  https://researchguides.library.vanderbilt.edu/c.php?g=68515&p=445977
  1 year
  https://stooq.com/q/?s=amzn.us&c=1y&t=l&a=lg&b=0
  https://stooq.com/q/l/?s=amzn.us&f=sd2t2ohlcv&h&e=csv
  https://fred.stlouisfed.org/categories/33194
  https://finance.yahoo.com/lookup?s=T
  https://finance.yahoo.com/quote/NVDA/history/
  #https://www.investing.com/equities/nvidia-corp-historical-data
  https://datahub.io/collections/stock-market-data
  https://datahub.io/core/s-and-p-500-companies#data-cli
  https://data-explorer.oecd.org/?lc=en
  https://pages.stern.nyu.edu/~adamodar/New_Home_Page/datafile/histretSP.html



  # investment advisors
  https://adviserinfo.sec.gov/

  # XML technical specifications
  https://www.sec.gov/edgar/filer/technical-specifications

  # EDGAR company database
  https://www.edgarcompany.sec.gov/


  # from bellingcat
  https://www.bellingcat.com/resources/2023/12/18/new-tools-dig-deeper-into-hard-to-aggregate-us-corporate-data/
  https://www.sec.gov/files/company_tickers.json
  https://www.sec.gov/Archives/edgar/xbrlrss.all.xml


  https://data.sec.gov/submissions/CIK##########.json

  XBRL Extensible Business Markup Language(XML)

  obsolete
  company facts json file has concepts for company concepts
  facts, concepts and xbrl  json files contain two json dictionaries each
  this sedfile converts them to a two item array of dictionaries
  sedfile s/^\([{].*[}]\)\([{].*[}]\)$/[\1,\2]/

  # company concepts
  Revenues GrossProfit EarningsPerShareBasic Dividends EquityPublicFloat CostofGoodsandServicesSold OperatingIncomeLoss

  https://www.sec.gov/Archives/edgar/xbrlrss.all.xml

  # company concept
  https://xbrl.us/forums/topic/how-to-find-a-complete-list-of-similar-concept/

  https://data.sec.gov/api/xbrl/companyconcept/CIK##########/us-gaap/AccountsPayableCurrent.json
  https://data.sec.gov/api/xbrl/companyconcept/CIK##########/us-gaap/AccountsAndNotesReceivableNet.json
  https://data.sec.gov/api/xbrl/companyconcept/CIK##########/us-gaap/GrossProfit.json
  https://data.sec.gov/api/xbrl/companyfacts/CIK##########.json
  https://data.sec.gov/api/xbrl/frames/us-gaap/AccountsPayableCurrent/USD/CY2019Q1I.json
  https://data.sec.gov/api/xbrl/frames/us-gaap/AccountsAndNotesReceivableNet/USD/CY2019Q1I.json
  CY#### for annual datao
  CY####Q# for quarterly data
  CY####Q#I for instantaneous data

  https://www.sec.gov/Archives/edgar/daily-index/xbrl/companyfacts.zip
  https://www.sec.gov/Archives/edgar/daily-index/bulkdata/submissions.zip

  https://www.sec.gov/edgar/search-and-access

  # edgar full text search
  https://www.sec.gov/edgar/searchedgar/edgarfulltextfaq.htm
  https://www.sec.gov/edgar/search/
  ecample:
  https://www.sec.gov/edgar/search/#/ciks=0000315090&
                entityName=BUFFETT%2520WARREN%2520E%2520(CIK%25200000315090)

  tax 
  https://americansfortaxfairness.org/ultra-wealthys-8-5-trillion-untaxed-income/
  https://www.federalreserve.gov/econres/aboutscf.htm

# plotly

https://github.com/plotly/plotly.js
fig.to_json()

https://plotly.com/python/creating-and-updating-figures/
https://stackoverflow.com/questions/39867224/plotly-js-only-one-plot-working-when-using-multiple-plots-on-same-page
https://plnkr.co/edit/XluyqzOLOYAtdzp9EevX?p=preview&preview
https://plotly.com/python/figure-structure/

#
