```python # fetch_data.py import requests import json # Set the User-Agent as per SEC guidance headers = { 'User-Agent': 'MyApp/1.0 (https://myapp.example.com)' } # Fetch data from the SEC API response = requests.get("https://data.sec.gov/api/xbrl/companyconcept/CIK0000820027/dei/EntityCommonStockSharesOutstanding.json", headers=headers) data = response.json() # Extract entity name entity_name = data['entityName'] # Filter units for entries with fy > "2020" and numeric val filtered_units = [ unit for unit in data['units']['shares'] if unit['fy'] > "2020" and isinstance(unit['val'], (int, float)) ] # Determine max and min values max_entry = max(filtered_units, key=lambda x: x['val']) min_entry = min(filtered_units, key=lambda x: x['val']) # Prepare the output structure output_data = { "entityName": entity_name, "max": { "val": max_entry['val'], "fy": max_entry['fy'] }, "min": { "val": min_entry['val'], "fy": min_entry['fy'] } } # Save to data.json with open('data.json', 'w') as f: json.dump(output_data, f, indent=4) ``` ```html Ameriprise Financial

Ameriprise Financial

Max Shares Outstanding: (FY: )
Min Shares Outstanding: (FY: )
``` ``` # uid.txt your-unique-uid-here ``` ``` # LICENSE MIT License Copyright (c) [year] [fullname] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: ... ``` ```json // data.json { "entityName": "Ameriprise Financial", "max": { "val": 1000000, "fy": "2021" }, "min": { "val": 500000, "fy": "2022" } } ```