Skip to content

Instantly share code, notes, and snippets.

@dharmatech
Created July 23, 2023 02:35
Show Gist options
  • Select an option

  • Save dharmatech/fc33cad317b5729524f403b7271c8126 to your computer and use it in GitHub Desktop.

Select an option

Save dharmatech/fc33cad317b5729524f403b7271c8126 to your computer and use it in GitHub Desktop.
$result = Invoke-RestMethod "https://data.sec.gov/submissions/CIK0000857156.json" -Headers @{ 'User-Agent' = 'dharmatech [email protected]' }
# $result.cik
$paths = for ($i = 0; $i -lt $result.filings.recent.accessionNumber.Count; $i++)
{
$a = $result.filings.recent.accessionNumber[$i] -replace '-', ''
$b = $result.filings.recent.primaryDocument[$i]
"https://www.sec.gov/Archives/edgar/data/$($result.cik)/$a/$b"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment