### Create new Edgar client with imports Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Example showing the necessary import and instantiation of the Edgar client. ```rust use edgarkit::Edgar; let edgar = Edgar::new("my_app/1.0 (email@example.com)")?; ``` -------------------------------- ### Initialize EdgarConfig Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.EdgarConfig.html Examples for creating an EdgarConfig instance using default settings or custom parameters. ```rust let config = EdgarConfig::default(); ``` ```rust let config = EdgarConfig::new( "research_app/1.0 contact@university.edu", 5, // More conservative rate Duration::from_secs(45), None, // Use default URLs ); ``` -------------------------------- ### SearchOperations Usage Example Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.SearchOperations.html Demonstrates how to initialize an Edgar client and perform both single-page and multi-page searches using SearchOptions. ```rust use edgarkit::{Edgar, SearchOperations, SearchOptions}; async fn example() -> Result<(), Box> { let edgar = Edgar::new("your_app_name contact@example.com")?; let options = SearchOptions::new() .with_forms(vec!["10-K".to_string()]) .with_count(10); // Single page let first_page = edgar.search(options.clone()).await?; println!("First page: {} results", first_page.hits.hits.len()); // All results across pages let all_results = edgar.search_all(options).await?; println!("Total results: {}", all_results.len()); Ok(()) } ``` -------------------------------- ### Create Custom EdgarConfig Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.EdgarConfig.html Example showing the usage of the new constructor with explicit imports. ```rust use edgarkit::{EdgarConfig, EdgarUrls}; use std::time::Duration; let config = EdgarConfig::new( "MyApp contact@example.com", 10, Duration::from_secs(30), None, ); ``` -------------------------------- ### Fetch SEC Feeds with FeedOptions Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FeedOptions.html A comprehensive example demonstrating how to use FeedOptions within an Edgar client to fetch various SEC feeds. ```rust 15async fn main() -> Result<(), Box> { 16 let edgar = Edgar::new("EdgarKit Example user@example.com")?; 17 18 println!("=== EdgarKit RSS/Atom Feeds Example ===\n"); 19 20 // Example 1: Get current filings feed 21 println!("1. Fetching current filings feed..."); 22 let current_feed = edgar.current_feed(None).await?; 23 println!("✓ Feed Title: {}", current_feed.title); 24 println!("✓ Last Updated: {}", current_feed.updated); 25 println!("✓ Total Entries: {}", current_feed.entries.len()); 26 27 if let Some(first_entry) = current_feed.entries.first() { 28 println!("\n Most Recent Filing:"); 29 println!(" - Title: {}", first_entry.title); 30 } 31 32 // Example 2: Get company-specific feed with options 33 println!("\n2. Fetching company-specific feed for Apple (CIK: 320193)..."); 34 let feed_options = FeedOptions::new(None) 35 .with_param("count", "10") 36 .with_param("type", "10-K"); 37 38 let company_feed = edgar.company_feed("320193", Some(feed_options)).await?; 39 println!("✓ Company: {}", company_feed.title); 40 41 if let Some(company_info) = &company_feed.company_info { 42 println!("✓ Conformed Name: {}", company_info.conformed_name); 43 println!( 44 "✓ SIC: {} - {}", 45 company_info.assigned_sic, company_info.assigned_sic_desc 46 ); 47 } 48 49 println!("✓ Found {} filings", company_feed.entries.len()); 50 51 // Example 3: SEC press releases 52 println!("\n3. Fetching SEC press releases..."); 53 let press_releases = edgar.press_release_feed().await?; 54 println!("✓ Feed: {}", press_releases.channel.title); 55 println!( 56 "✓ Recent press releases: {}", 57 press_releases.channel.items.len() 58 ); 59 60 if let Some(first_item) = press_releases.channel.items.first() { 61 println!("\n Latest Press Release:"); 62 println!(" - {}", first_item.title); 63 println!( 64 " - Published: {}", 65 first_item.pub_date.as_deref().unwrap_or("N/A") 66 ); 67 } 68 69 // Example 4: Administrative proceedings feed 70 println!("\n4. Fetching administrative proceedings feed..."); 71 let proceedings = edgar.administrative_proceedings_feed().await?; 72 println!("✓ Feed: {}", proceedings.channel.title); 73 println!("✓ Items: {}", proceedings.channel.items.len()); 74 75 if !proceedings.channel.items.is_empty() { 76 println!("\n Recent proceedings items:"); 77 for (i, item) in proceedings.channel.items.iter().take(3).enumerate() { 78 println!(" {}. {}", i + 1, item.title); 79 } 80 } 81 82 // Example 5: XBRL feeds 83 println!("\n5. Fetching inline XBRL feed..."); 84 let xbrl_feed = edgar.inline_xbrl_feed().await?; 85 println!("✓ Feed: {}", xbrl_feed.channel.title); 86 println!("✓ XBRL filings: {}", xbrl_feed.channel.items.len()); 87 88 // Example 6: Historical XBRL feed 89 println!("\n6. Fetching historical XBRL feed (January 2024)..."); 90 let historical_xbrl = edgar.historical_xbrl_feed(2024, 1).await?; 91 println!("✓ Feed: {}", historical_xbrl.channel.title); 92 println!( 93 "✓ Historical items: {}", 94 historical_xbrl.channel.items.len() 95 ); 96 97 println!("\n✓ RSS/Atom feeds examples completed successfully!"); 98 println!("\nNote: These feeds are updated regularly by the SEC."); 99 println!("For real-time monitoring, consider polling these feeds periodically."); 100 101 Ok(()) 102} ``` -------------------------------- ### Initialize IndexParser Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/index/struct.IndexParser.html Creates a new IndexParser instance with default configuration. This is the starting point for parsing EDGAR index files. ```rust use edgarkit::parsing::index::{IndexParser, IndexConfig}; let config = IndexConfig::default(); let parser = IndexParser::new(config); ``` -------------------------------- ### GET /daily_index Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Fetches the daily index directory listing for a given period. ```APIDOC ## GET /daily_index ### Description Retrieves the directory listing for a daily index, including parent directory information and available files. ### Method GET ``` -------------------------------- ### GET /index.json Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.IndexResponse.html Retrieves the directory listing payload for the Edgarkit index. ```APIDOC ## GET /index.json ### Description Returns the directory listing payload for the project index. ### Method GET ### Endpoint /index.json ### Response #### Success Response (200) - **directory** (Directory) - The directory listing payload. ``` -------------------------------- ### Get Multiple Form Types with FilingOptions Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Demonstrates fetching filings of multiple specified form types using `FilingOptions`. Ensure the `Edgar` client is initialized. ```rust let multi_options = FilingOptions::new() .with_form_types(vec![ "10-K".to_string(), "10-Q".to_string(), "8-K".to_string(), ]) .with_limit(10); let multi_filings = edgar.filings(cik, Some(multi_options)).await?; ``` -------------------------------- ### Creating a New SearchOptions Instance Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.SearchOptions.html Initializes a new SearchOptions struct with default values. This is the starting point for building a search query using the builder pattern. ```rust pub fn new() -> Self ``` -------------------------------- ### Initialize Edgar Client and Get Company CIK Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.CompanyOperations.html Initializes the Edgar client with a user agent string and retrieves the CIK for a given company ticker. Ensure a valid user agent is provided for API requests. ```rust let edgar = Edgar::new("MyApp contact@example.com")?; // Get CIK for a company let apple_cik = edgar.company_cik("AAPL").await?; ``` -------------------------------- ### Get Daily Index Directory Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Retrieves the directory listing for a specific daily index, showing available files. ```APIDOC ## GET /index/daily ### Description Fetches the directory listing for a daily SEC filing index. This provides metadata about the index, including its name, parent directory, and a list of available files within that index. ### Method GET ### Endpoint /index/daily ### Parameters #### Query Parameters - **period** (string) - Optional - The fiscal period for which to fetch the daily index (YYYY-Q[1-4]). If not provided, the latest period is assumed. ### Request Example ```json { "period": "2024-Q3" } ``` ### Response #### Success Response (200) - **directory** (object) - Contains information about the index directory. - **name** (string) - The name of the directory. - **parent_dir** (string) - The parent directory path. - **item** (array) - A list of items (files) within the directory, each with a name and type. #### Response Example ```json { "directory": { "name": "edgar/daily-index/2024/Q3", "parent_dir": "edgar/daily-index/2024", "item": [ { "name": "master.zip", "type_": "file" }, { "name": "num.txt", "type_": "file" } ] } } ``` ``` -------------------------------- ### Get Daily and Quarterly Filings Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.IndexOperations.html Demonstrates how to retrieve daily and quarterly filings using the IndexOperations trait. Requires setting up an Edgar client with an email address and optionally filtering daily filings by form type. ```rust use edgarkit::{ Edgar, EdgarDay, EdgarPeriod, FilingOptions, IndexOperations, Quarter, }; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("MyApp contact@example.com")?; let day = EdgarDay::new(2023, 8, 15)?; let opts = FilingOptions::new().with_form_type("10-K".to_string()); let daily = edgar.get_daily_filings(day, Some(opts)).await?; let period = EdgarPeriod::new(2023, Quarter::Q3)?; let quarterly = edgar.get_period_filings(period, None).await?; println!("daily={}, quarterly={}", daily.len(), quarterly.len()); Ok(()) } ``` -------------------------------- ### Edgar Client Initialization Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Demonstrates how to create an Edgar client instance with custom configuration settings. ```APIDOC ## POST /api/users ### Description Creates an Edgar client with custom configuration settings. Use this constructor when you need to customize the rate limit, timeout duration, or base URLs. This is useful for testing with mock servers, adjusting performance characteristics for your use case, or complying with different rate limit policies. ### Method POST ### Endpoint /api/users ### Parameters #### Path Parameters - **config** (EdgarConfig) - Required - An `EdgarConfig` struct containing your custom settings including user agent, rate limit (requests per second), HTTP timeout, and base URLs for the various EDGAR services. ### Request Example ```json { "config": { "user_agent": "research_tool/1.0", "rate_limit": 5, "timeout": "60s", "base_urls": { "archives": "https://www.sec.gov/Archives", "data": "https://data.sec.gov", "files": "https://www.sec.gov/files", "search": "https://www.sec.gov/cgi-bin/browse-edgar" } } } ``` ### Response #### Success Response (200) - **Edgar** (object) - The initialized Edgar client. #### Response Example ```json { "edgar_client": "" } ``` ### Errors - **EdgarError::ConfigError** - If the user agent is malformed, the rate limit is zero, or the HTTP client cannot be built with the provided configuration. ``` -------------------------------- ### GET /company_concept Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Fetches company-specific financial concepts. ```APIDOC ## GET /company_concept ### Description Fetches and parses company-specific financial concepts for a given company. ### Method GET ### Endpoint /company_concept ### Parameters #### Query Parameters - **cik** (u64) - Required - The CIK of the company. - **taxonomy** (str) - Required - The financial taxonomy (e.g., "us-gaap", "ifrs"). - **tag** (str) - Required - The specific financial concept tag. ### Response #### Success Response (200) - **Result** - The parsed financial concept data. ``` -------------------------------- ### GET /frames Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Fetches financial frames for a specific concept. ```APIDOC ## GET /frames ### Description Fetches and parses financial frames for a specific financial concept within a given taxonomy, unit, and period. ### Method GET ### Endpoint /frames ### Parameters #### Query Parameters - **taxonomy** (str) - Required - The financial taxonomy (e.g., "us-gaap"). - **tag** (str) - Required - The specific financial concept tag. - **unit** (str) - Required - The unit of measurement (e.g., "USD"). - **period** (str) - Required - The financial period (e.g., "CY2019Q1I"). ### Response #### Success Response (200) - **Result** - The parsed financial frame data. ``` -------------------------------- ### Initialize and Configure FeedOptions Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FeedOptions.html Create a new FeedOptions instance and apply custom query parameters. ```rust let options = FeedOptions::new(None) .with_param("count", "50") .with_param("type", "10-K"); ``` -------------------------------- ### GET /full_index Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Fetches the full quarterly index metadata. ```APIDOC ## GET /full_index ### Description Retrieves the complete quarterly index metadata, including directory details and available files. ### Method GET ``` -------------------------------- ### get_recent_filings Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.FilingOperations.html Helper function to get recent filings for a company. ```APIDOC ## get_recent_filings ### Description Helper function to get recent filings in a form of a Vec. ### Parameters #### Path Parameters - **cik** (str) - Required - The Central Index Key (CIK) of the company. ### Response - **Result>** - Returns a Result containing a list of recent filings. ``` -------------------------------- ### GET /company_tickers Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.CompanyOperations.html Retrieves a list of all company tickers from EDGAR. ```APIDOC ## GET /company_tickers ### Description Retrieves a list of all company tickers from EDGAR. ### Method GET ### Response #### Success Response (200) - **tickers** (Vec) - A list of company ticker objects. ``` -------------------------------- ### Basic Usage: Retrieve Recent Filings Source: https://docs.rs/edgarkit/0.1.1/edgarkit/index.html Demonstrates how to initialize the Edgar client and fetch recent 10-K filings for a specific company. Ensure you replace 'YourAppName contact@example.com' with your actual application name and contact information as required by SEC.gov. ```rust use edgarkit::{Edgar, FilingOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { // Initialize with a proper user agent (required by SEC.gov) let edgar = Edgar::new("YourAppName contact@example.com")?; // Get recent 10-K filings for a company let options = FilingOptions::new() .with_form_type("10-K") .with_limit(5); let filings = edgar.filings("320193", Some(options)).await?; for filing in filings { println!("Filing: {} on {}", filing.form, filing.filing_date); } Ok(()) } ``` -------------------------------- ### GET Administrative Proceedings Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FeedOptions.html Fetches the feed of administrative proceedings. ```APIDOC ## GET /administrative_proceedings_feed ### Description Retrieves the feed of administrative proceedings. ### Method GET ### Endpoint administrative_proceedings_feed() ``` -------------------------------- ### Building SearchOptions with Builder Pattern Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.SearchOptions.html Demonstrates how to construct SearchOptions using a fluent builder pattern, chaining methods to set various search parameters like query, forms, date range, and count. This is the recommended way to configure search queries. ```rust let options = SearchOptions::new() .with_query("acquisition merger") .with_forms(vec!["8-K".to_string()]) .with_date_range("2024-01-01".to_string(), "2024-12-31".to_string()) .with_count(100); ``` -------------------------------- ### GET /company_facts Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Retrieves comprehensive financial and operational data for a specific company. ```APIDOC ## GET /company_facts ### Description Fetches comprehensive financial and operational data about a company from the SEC EDGAR database using its CIK. ### Method GET ### Endpoint /company_facts ### Parameters #### Query Parameters - **cik** (u64) - Required - The Central Index Key (CIK) of the company. ### Response #### Success Response (200) - **Result** - A struct encapsulating all retrieved facts about the company. ``` -------------------------------- ### Perform a comprehensive search with search_all Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Demonstrates how to configure search options and retrieve all matching hits using the search_all method. ```rust let options = SearchOptions::new() .with_query("quarterly earnings") .with_forms(vec!["10-Q".to_string()]) .with_date_range("2024-01-01".to_string(), "2024-03-31".to_string()); let all_results = edgar.search_all(options).await?; println!("Retrieved {} quarterly reports", all_results.len()); for hit in all_results { println!("{}: {} filed on {}", hit._source.display_names[0], hit._source.form, hit._source.file_date); } ``` -------------------------------- ### Get Full Index Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Retrieves the complete metadata for a specified quarterly index. ```APIDOC ## GET /index/full ### Description Retrieves the full metadata for a specified quarterly index. This endpoint provides a comprehensive view of all filings within a given fiscal period, including file names and types. ### Method GET ### Endpoint /index/full ### Parameters #### Query Parameters - **period** (string) - Optional - The fiscal period for which to fetch the full index (YYYY-Q[1-4]). If not provided, the latest period is assumed. ### Request Example ```json { "period": "2024-Q3" } ``` ### Response #### Success Response (200) - **directory** (object) - Contains information about the index directory. - **name** (string) - The name of the directory. - **item** (array) - A list of items (files) within the directory, each with a name and type. #### Response Example ```json { "directory": { "name": "full-index/2024/Q3", "item": [ { "name": "company.idx", "type_": "file" }, { "name": "form.idx", "type_": "file" } ] } } ``` ``` -------------------------------- ### Configure Filing Options with Form Types Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Demonstrates how to create and configure `FilingOptions` to specify a list of desired form types for filtering filings. ```rust pub fn with_form_types(self, form_types: Vec) -> Self ``` -------------------------------- ### AtomParser::new Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/atom/struct.AtomParser.html Initializes a new AtomParser with the specified configuration. ```APIDOC ## AtomParser::new ### Description Initializes a new `AtomParser` with the specified configuration. ### Method `pub fn new(config: AtomConfig) -> Self` ### Parameters #### Request Body - **config** (AtomConfig) - Required - Configuration for the Atom parser, including options like `follow_links`, `max_entries`, and `filter_categories`. ### Request Example ```json { "config": { "follow_links": false, "max_entries": 10, "filter_categories": ["tech"] } } ``` ### Response #### Success Response (200) - **AtomParser** (AtomParser) - An instance of the AtomParser struct. #### Response Example ```json { "parser": "" } ``` ``` -------------------------------- ### GET /period_filings Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Retrieves filings for a specific period, with optional filtering by CIK. ```APIDOC ## GET /period_filings ### Description Fetches filings for a specific period. Supports filtering by CIK (Central Index Key). ### Method GET ### Parameters #### Request Body (FilingOptions) - **cik** (u64) - Optional - The CIK identifier for a specific company. ``` -------------------------------- ### Create FilingOptions with Multiple Form Types and Pagination Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Shows how to configure FilingOptions with multiple form types and apply pagination using offset and limit. This is useful for retrieving specific filings across different types and skipping initial results. ```rust let options = FilingOptions::new() .with_form_types(vec!["10-K".to_string(), "10-Q".to_string()]) .with_offset(20) .with_limit(10); ``` -------------------------------- ### Search for EDGAR Filings using SearchOptions Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.SearchOptions.html Demonstrates how to configure search queries, filter by form types, set date ranges, and handle pagination using the EdgarKit library. ```rust async fn main() -> Result<(), Box> { let edgar = Edgar::new("EdgarKit Example user@example.com")?; println!("=== EdgarKit Search Example ===\n"); // Example 1: Search for recent 10-K filings println!("1. Searching for recent 10-K filings..."); let options = SearchOptions::new() .with_forms(vec!["10-K".to_string()]) .with_count(5); // Limit to 5 results for the example let response = edgar.search(options).await?; println!("✓ Found {} total 10-K filings", response.hits.total.value); println!("✓ Showing first {} results:\n", response.hits.hits.len()); for (i, hit) in response.hits.hits.iter().enumerate() { println!( " {}. {} - {} (filed: {})", i + 1, hit._source .display_names .first() .unwrap_or(&"Unknown".to_string()), hit._source.form, hit._source.file_date ); } // Example 2: Search for SPAC-related S-1 filings with date range println!("\n2. Searching for SPAC-related S-1 filings..."); let spac_options = SearchOptions::new() .with_query(r#""Special Purpose Acquisition""#) .with_forms(vec!["S-1".to_string()]) .with_date_range("2024-01-01".to_string(), "2024-12-31".to_string()) .with_count(10); let spac_response = edgar.search(spac_options).await?; println!( "✓ Found {} SPAC S-1 filings in 2024", spac_response.hits.total.value ); // Example 3: Use search_all for automatic pagination println!("\n3. Demonstrating automatic pagination with search_all..."); let pagination_options = SearchOptions::new() .with_query("Apple") .with_forms(vec!["8-K".to_string()]) .with_count(100); // Request 100 per page println!(" Fetching all results (this may take a moment)..."); let all_results = edgar.search_all(pagination_options).await?; println!( "✓ Retrieved {} total filings across all pages", all_results.len() ); println!("\n✓ Search examples completed successfully!"); Ok(()) } ``` -------------------------------- ### Get RSS Feed from URL Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.FeedOperations.html Retrieves an RSS feed from a specified URL. ```APIDOC ## GET /feed/rss/{url} ### Description Retrieves an RSS feed from a specified URL. ### Method GET ### Endpoint /feed/rss/{url} ### Path Parameters - **url** (string) - Required - The URL of the RSS feed. ### Response #### Success Response (200) - **RssDocument** - The retrieved RSS feed. ``` -------------------------------- ### GET /company_facts Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.CompanyOperations.html Retrieves company facts and financial data for a given CIK. ```APIDOC ## GET /company_facts ### Description Retrieves company facts and financial data for a given CIK. ### Method GET ### Parameters #### Query Parameters - **cik** (u64) - Required - The Central Index Key of the company. ### Response #### Success Response (200) - **facts** (CompanyFacts) - The structured financial data for the company. ``` -------------------------------- ### Initialize Edgar client Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Basic initialization of the Edgar client using a required user-agent string. ```rust let edgar = Edgar::new("my_app/1.0 (my@email.com)")?; ``` -------------------------------- ### GET SEC Press Releases Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FeedOptions.html Fetches the feed of SEC press releases. ```APIDOC ## GET /press_release_feed ### Description Retrieves the latest SEC press releases. ### Method GET ### Endpoint press_release_feed() ``` -------------------------------- ### GET Company-Specific Feed Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FeedOptions.html Fetches a feed for a specific company identified by its CIK. ```APIDOC ## GET /company_feed/{cik} ### Description Retrieves a feed for a specific company using its CIK and optional feed parameters. ### Method GET ### Endpoint company_feed(cik, options) ### Parameters #### Path Parameters - **cik** (string) - Required - The Central Index Key of the company. #### Request Body - **count** (string) - Optional - Number of entries to return. - **type** (string) - Optional - Filing type (e.g., 10-K). ``` -------------------------------- ### POST /client/initialization Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Initializes a new Edgar client instance with a required user agent string to comply with SEC fair access guidelines. ```APIDOC ## POST /client/initialization ### Description Creates a new Edgar client instance. The user agent must follow the format 'AppName/Version (contact@email.com)' as required by the SEC. ### Method POST ### Parameters #### Request Body - **user_agent** (string) - Required - A descriptive identifier for your application including contact information. ### Request Example { "user_agent": "my_app/1.0 (email@example.com)" } ### Response #### Success Response (200) - **client** (Edgar) - A configured Edgar client instance ready for requests. #### Response Example { "status": "success", "message": "Client initialized" } ``` -------------------------------- ### GET Current Filings Feed Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FeedOptions.html Fetches the current SEC filings feed. ```APIDOC ## GET /current_feed ### Description Retrieves the current SEC filings feed. ### Method GET ### Endpoint current_feed(None) ``` -------------------------------- ### Get edgarkit Version Source: https://docs.rs/edgarkit/0.1.1/edgarkit/constant.VERSION.html Access the current crate version as a string slice. ```rust pub const VERSION: &str = "0.1.1"; ``` -------------------------------- ### FilingOptions Configuration Methods Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Methods available for configuring filing retrieval options. ```rust pub fn with_offset(self, offset: usize) -> Self ``` ```rust pub fn with_limit(self, limit: usize) -> Self ``` -------------------------------- ### Create FilingOptions with Form Type and Limit Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Demonstrates basic usage of FilingOptions by setting a specific form type and a limit for the results. Use this when you need to filter by a single form type and control the number of returned filings. ```rust let options = FilingOptions::new() .with_form_type("10-K") .with_limit(10); ``` -------------------------------- ### GET /mutual_fund_tickers Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Retrieves a list of mutual fund tickers from the SEC EDGAR database. ```APIDOC ## GET /mutual_fund_tickers ### Description Fetches the company_tickers_mf.json file from the SEC EDGAR database, which contains information about mutual fund tickers, CIK numbers, and fund names. ### Method GET ### Endpoint /mutual_fund_tickers ### Response #### Success Response (200) - **Result>** - A vector of MutualFundTicker structs containing fund information. #### Errors - EdgarError::RequestError: Error sending request or reading response. - EdgarError::NotFound: File not found. - EdgarError::InvalidResponse: Response could not be parsed. ``` -------------------------------- ### Create an Edgar client with custom configuration Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Use this constructor to customize rate limits, timeouts, and base URLs. Ensure the user agent is valid and the rate limit is non-zero to avoid configuration errors. ```rust use edgarkit::{Edgar, EdgarConfig, EdgarUrls}; use std::time::Duration; let config = EdgarConfig { user_agent: "research_tool/1.0".to_string(), rate_limit: 5, // More conservative rate timeout: Duration::from_secs(60), base_urls: EdgarUrls::default(), }; let edgar = Edgar::with_config(config)?; ``` -------------------------------- ### GET XBRL Feeds Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FeedOptions.html Fetches inline XBRL feeds or historical XBRL data. ```APIDOC ## GET /inline_xbrl_feed ### Description Retrieves the inline XBRL feed. ### Method GET ### Endpoint inline_xbrl_feed() ## GET /historical_xbrl_feed/{year}/{month} ### Description Retrieves historical XBRL feed for a specific year and month. ### Method GET ### Endpoint historical_xbrl_feed(year, month) ### Parameters #### Path Parameters - **year** (integer) - Required - The year of the feed. - **month** (integer) - Required - The month of the feed. ``` -------------------------------- ### Get Filing URL from ID API Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.FilingOperations.html Constructs a filing URL from a combined filing ID. ```APIDOC ## GET /get_filing_url_from_id ### Description Constructs a filing URL from a combined filing ID (format: “accession_number:filename”). ### Method GET ### Endpoint /get_filing_url_from_id ### Parameters #### Query Parameters - **cik** (string) - Required - The CIK (Central Index Key) of the company. - **filing_id** (string) - Required - The filing ID in the format “accession_number:filename”. ### Response #### Success Response (200) - **string** - The constructed filing URL. ``` -------------------------------- ### Initialize Edgar Client Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Initializes the Edgar client with a user agent string. This is the first step before making any API calls. ```rust let edgar = Edgar::new("EdgarKit Example user@example.com")?; ``` -------------------------------- ### GET /company_cik Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.CompanyOperations.html Retrieves the Central Index Key (CIK) for a given company ticker symbol. ```APIDOC ## GET /company_cik ### Description Retrieves the Central Index Key (CIK) for a given company ticker symbol. ### Method GET ### Parameters #### Query Parameters - **ticker** (str) - Required - The ticker symbol of the company. ### Response #### Success Response (200) - **cik** (u64) - The Central Index Key for the company. ``` -------------------------------- ### CloneToUninit Implementation (Nightly) Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/atom/struct.AtomDocument.html Nightly-only experimental API for performing copy-assignment to uninitialized memory. Use with caution and ensure proper memory management. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### Get Filing Content by ID API Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.FilingOperations.html Fetches a filing's content directly using its URL. ```APIDOC ## GET /get_filing_content_by_id ### Description Fetches a filing’s content directly using its URL. ### Method GET ### Endpoint /get_filing_content_by_id ### Parameters #### Query Parameters - **cik** (string) - Required - The CIK (Central Index Key) of the company. - **filing_id** (string) - Required - The filing ID (typically accession number). ### Response #### Success Response (200) - **string** - The content of the filing. ``` -------------------------------- ### Perform Index Operations with EdgarKit Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.EdgarDay.html Demonstrates various methods for retrieving and filtering SEC EDGAR filings and index directories. ```rust 16async fn main() -> Result<(), Box> { 17 let edgar = Edgar::new("EdgarKit Example user@example.com")?; 18 19 println!("=== EdgarKit Index Operations Example ===\n"); 20 21 // Example 1: Get daily filings for a specific date 22 println!("1. Fetching daily filings for a specific date..."); 23 let day = EdgarDay::new(2024, 8, 15)?; 24 25 let options = FilingOptions::new().with_form_type("10-K").with_limit(10); 26 27 let daily_filings = edgar.get_daily_filings(day, Some(options)).await?; 28 println!( 29 "✓ Found {} 10-K filings on {}", 30 daily_filings.len(), 31 day.format_date() 32 ); 33 34 for (i, entry) in daily_filings.iter().take(5).enumerate() { 35 println!( 36 " {}. {} - {} (CIK: {})", 37 i + 1, 38 entry.company_name, 39 entry.form_type, 40 entry.cik 41 ); 42 } 43 44 // Example 2: Get quarterly index 45 println!("\n2. Fetching quarterly index for Q3 2024..."); 46 let period = EdgarPeriod::new(2024, Quarter::Q3)?; 47 let period_filings = edgar.get_period_filings(period, None).await?; 48 println!("✓ Found {} filings in Q3 2024", period_filings.len()); 49 50 // Count filings by form type 51 let mut form_counts = HashMap::new(); 52 for entry in &period_filings { 53 *form_counts.entry(entry.form_type.trim()).or_insert(0) += 1; 54 } 55 56 println!("\n Top form types in Q3 2024:"); 57 let mut sorted_forms: Vec<_> = form_counts.iter().collect(); 58 sorted_forms.sort_by(|a, b| b.1.cmp(a.1)); 59 for (form, count) in sorted_forms.iter().take(10) { 60 println!(" - {}: {} filings", form, count); 61 } 62 63 // Example 3: Filter by multiple form types 64 println!("\n3. Filtering for specific form types..."); 65 let multi_form_options = FilingOptions::new() 66 .with_form_types(vec![ 67 "10-K".to_string(), 68 "10-Q".to_string(), 69 "S-1".to_string(), 70 ]) 71 .with_limit(20); 72 73 let filtered_daily = edgar 74 .get_daily_filings(day, Some(multi_form_options)) 75 .await?; 76 println!( 77 "✓ Found {} filings of types 10-K, 10-Q, S-1", 78 filtered_daily.len() 79 ); 80 81 // Example 4: Get daily index response (directory listing) 82 println!("\n4. Fetching daily index directory..."); 83 let daily_index = edgar.daily_index(Some(period)).await?; 84 println!("✓ Index directory name: {}", daily_index.directory.name); 85 println!("✓ Parent directory: {}", daily_index.directory.parent_dir); 86 println!("✓ Files available: {}", daily_index.directory.item.len()); 87 88 println!("\n Available index files:"); 89 for (i, item) in daily_index.directory.item.iter().take(10).enumerate() { 90 println!(" {}. {} ({:?})", i + 1, item.name, item.type_); 91 } 92 93 // Example 5: Get full quarterly index 94 println!("\n5. Fetching full quarterly index metadata..."); 95 let full_index = edgar.full_index(Some(period)).await?; 96 println!("✓ Full index for: {}", full_index.directory.name); 97 println!("✓ Available files: {}", full_index.directory.item.len()); 98 99 // Example 6: Filter by CIK 100 println!("\n6. Filtering filings by specific CIK..."); 101 let cik_options = FilingOptions::new().with_cik(320193); // Apple 102 103 let apple_filings = edgar.get_period_filings(period, Some(cik_options)).await?; 104 println!( 105 "✓ Found {} filings for Apple in Q3 2024", 106 apple_filings.len() 107 ); 108 109 for (i, filing) in apple_filings.iter().enumerate() { 110 println!( 111 " {}. {} - filed on {}", 112 i + 1, 113 filing.form_type, 114 filing.date_filed 115 ); 116 } 117 118 println!("\n✓ Index operations examples completed successfully!"); 119 println!("\nNote: Index files provide a comprehensive view of all filings"); 120 println!("but may be large. Consider using specific filters to reduce data transfer."); 121 122 Ok(()) 123} ``` -------------------------------- ### GET /submissions/CIK##########.json Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Submission.html Retrieves the primary metadata and filing history for a specific company identified by its CIK. ```APIDOC ## GET /submissions/CIK##########.json ### Description Retrieves the primary metadata response for company-centric filing history. This includes a recent filings section and references to older filing files. ### Method GET ### Endpoint /submissions/CIK{cik}.json ### Parameters #### Path Parameters - **cik** (String) - Required - The zero-padded CIK of the company (e.g., 0000320193) ### Response #### Success Response (200) - **cik** (String) - Zero-padded CIK - **entity_type** (String) - Entity type (e.g., operating, investment) - **sic** (String) - Standard Industrial Classification code - **sic_description** (String) - Human-readable SIC description - **name** (String) - Conformed company name - **tickers** (Vec) - Exchange tickers - **exchanges** (Vec>) - Exchanges for tickers - **state_of_incorporation** (String) - State code of incorporation - **state_of_incorporation_description** (String) - State full name - **addresses** (Addresses) - Mailing and business addresses - **phone** (String) - Company phone - **flags** (String) - Misc flags - **former_names** (Vec) - Historical names - **filings** (FilingsData) - Recent filings data ``` -------------------------------- ### PolicyExt Implementation (And) Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/atom/struct.AtomDocument.html Combines two policies using a logical AND. The resulting policy returns `Action::Follow` only if both constituent policies do. ```rust fn and(self, other: P) -> And where T: Policy, P: Policy, ``` -------------------------------- ### Get IndexType as String Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/index/enum.IndexType.html Converts an IndexType variant to its string representation. Useful for logging or display purposes. ```rust pub fn as_str(&self) -> &'static str ``` -------------------------------- ### Initialize RssParser Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/rss/struct.RssParser.html Creates a new instance of RssParser with default configuration. This is the constructor for the RssParser. ```rust use edgarkit::parsing::rss::{RssParser, RssConfig}; let parser = RssParser::new(RssConfig::default()); ``` -------------------------------- ### IndexParser::new Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/index/struct.IndexParser.html Creates a new instance of IndexParser with the provided configuration. ```APIDOC ## fn new(config: IndexConfig) ### Description Creates a new IndexParser with the specified configuration settings. ### Parameters #### Request Body - **config** (IndexConfig) - Required - The configuration settings for the parser, including field widths, delimiters, and entry limits. ``` -------------------------------- ### Initialize AtomParser Source: https://docs.rs/edgarkit/0.1.1/edgarkit/parsing/atom/struct.AtomParser.html Create a new AtomParser instance using a configured AtomConfig object. ```rust use edgarkit::parsing::atom::{AtomParser, AtomConfig}; let config = AtomConfig { follow_links: false, max_entries: Some(10), filter_categories: vec!["tech".to_string()], }; let parser = AtomParser::new(config); ``` -------------------------------- ### GET /daily_filings Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Retrieves daily filings for a specific day, with optional filtering by form types and result limits. ```APIDOC ## GET /daily_filings ### Description Fetches filings for a specific day. Supports filtering by form types and limiting the number of results. ### Method GET ### Parameters #### Request Body (FilingOptions) - **form_types** (Vec) - Optional - List of form types to filter by (e.g., 10-K, 10-Q). - **limit** (usize) - Optional - Maximum number of filings to return. ``` -------------------------------- ### Retrieve SEC filings with filtering options Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.Edgar.html Demonstrates how to initialize the Edgar client and fetch filings with specific form types, including options to toggle the inclusion of amendments. ```rust use edgarkit::{Edgar, FilingOperations, FilingOptions}; #[tokio::main] async fn main() -> Result<(), Box> { let edgar = Edgar::new("app contact@example.com")?; // Returns both S-1 and S-1/A filings (default behavior). let opts = FilingOptions::new().with_form_type("S-1".to_string()); let filings = edgar.filings("320193", Some(opts)).await?; // Returns only S-1 filings, excluding amendments. let opts = FilingOptions::new() .with_form_type("S-1".to_string()) .with_include_amendments(false); let filings_no_amends = edgar.filings("320193", Some(opts)).await?; println!("with_amendments={}, without_amendments={}", filings.len(), filings_no_amends.len()); Ok(()) } ``` -------------------------------- ### Get Daily Filings Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.FilingOptions.html Fetches daily SEC filings, with options to filter by form type and limit the number of results. ```APIDOC ## GET /filings/daily ### Description Retrieves a list of daily SEC filings. This endpoint allows for filtering by specific form types and limiting the number of returned filings. ### Method GET ### Endpoint /filings/daily ### Parameters #### Query Parameters - **form_type** (string) - Optional - Filters filings by a specific form type (e.g., "10-K"). - **limit** (integer) - Optional - The maximum number of filings to return. - **day** (string) - Required - The specific date for which to fetch filings (YYYY-MM-DD). ### Request Example ```json { "day": "2024-08-15", "form_type": "10-K", "limit": 10 } ``` ### Response #### Success Response (200) - **filings** (array) - A list of filing objects, each containing company name, form type, and CIK. #### Response Example ```json { "filings": [ { "company_name": "Example Corp", "form_type": "10-K", "cik": 1234567, "date_filed": "2024-08-15" } ] } ``` ``` -------------------------------- ### Initialize and use EdgarDay Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.EdgarDay.html Demonstrates creating a new EdgarDay instance and accessing its date formatting and quarter calculation methods. ```rust use edgarkit::{EdgarDay, Quarter, Result}; fn main() -> Result<()> { let day = EdgarDay::new(2023, 12, 25)?; assert_eq!(day.format_date(), "20231225"); assert_eq!(day.quarter(), Quarter::Q4); Ok(()) } ``` -------------------------------- ### Get Latest Filing Content API Source: https://docs.rs/edgarkit/0.1.1/edgarkit/trait.FilingOperations.html Fetches the latest filing for a company matching one of the requested form types. ```APIDOC ## GET /get_latest_filing_content ### Description Fetches the latest filing for a company matching one of the requested form types. Use this when you want “latest 10-Q **or** 10-K”, etc. The forms are applied as a filter, and the newest matching filing (as returned by the SEC) is downloaded. ### Method GET ### Endpoint /get_latest_filing_content ### Parameters #### Query Parameters - **cik** (string) - Required - The CIK (Central Index Key) of the company. - **form_types** (array of strings) - Required - An array of form types to filter by (e.g., ["10-K", "10-Q"]). ### Response #### Success Response (200) - **string** - The content of the latest matching filing. ``` -------------------------------- ### CloneToUninit Implementation Source: https://docs.rs/edgarkit/0.1.1/edgarkit/struct.EdgarDay.html Provides functionality to clone data into uninitialized memory. This is an experimental, nightly-only feature. ```APIDOC ## impl CloneToUninit for T where T: Clone, ### Description Provides functionality to clone data into uninitialized memory. ### Method `unsafe fn clone_to_uninit(&self, dest: *mut u8)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ```