form4api 0.4.1__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: form4api
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Python client for the Form4API — real-time SEC Form 4 insider trading data
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://www.form4api.com
7
7
  Project-URL: Documentation, https://www.form4api.com/docs
8
8
  Project-URL: Repository, https://github.com/theodor90/form4api-py.git
9
+ Keywords: insider-trading,sec,sec-edgar,edgar,form-4,form4,form-144,13f,13f-hr,financial-data,stock-market,stocks,fintech,api,sdk,webhooks,form4api
9
10
  Requires-Python: >=3.11
10
11
  Description-Content-Type: text/markdown
11
12
  License-File: LICENSE
@@ -18,7 +19,12 @@ Dynamic: license-file
18
19
 
19
20
  # form4api
20
21
 
21
- Python client for [Form4API](https://form4api.com) — real-time SEC Form 4 insider trading data.
22
+ Python client for [Form4API](https://www.form4api.com) — real-time SEC Form 4 insider trading data.
23
+
24
+ [![PyPI version](https://img.shields.io/pypi/v/form4api.svg)](https://pypi.org/project/form4api/)
25
+ [![PyPI downloads](https://img.shields.io/pypi/dm/form4api.svg)](https://pypi.org/project/form4api/)
26
+ [![Python versions](https://img.shields.io/pypi/pyversions/form4api.svg)](https://pypi.org/project/form4api/)
27
+ [![license](https://img.shields.io/pypi/l/form4api.svg)](https://github.com/theodor90/form4api-py/blob/main/LICENSE)
22
28
 
23
29
  Supports Python 3.11+. Uses `httpx` for both sync and async HTTP.
24
30
 
@@ -1,190 +1,195 @@
1
- # form4api
2
-
3
- Python client for [Form4API](https://form4api.com) — real-time SEC Form 4 insider trading data.
4
-
5
- Supports Python 3.11+. Uses `httpx` for both sync and async HTTP.
6
-
7
- ## Installation
8
-
9
- ```bash
10
- pip install form4api
11
- ```
12
-
13
- ## Sync quickstart
14
-
15
- ```python
16
- from form4api import Form4ApiClient
17
-
18
- client = Form4ApiClient("YOUR_API_KEY")
19
-
20
- # Recent open-market purchases at Apple (excluding 10b5-1 plan trades)
21
- txns = client.transactions.list(ticker="AAPL", code="P", exclude_10b5=True, per_page=5)
22
- for t in txns:
23
- print(t.insider_name, t.insider_title, t.shares_amount, "@", t.price_per_share)
24
- print(f" open market: {t.is_open_market}, 10b5 plan: {t.is10b5_plan}, value: ${t.total_value:,.0f}")
25
-
26
- # Company overview (includes SIC, state, website)
27
- company = client.companies.get("MSFT")
28
- print(company.name, company.active_insiders, "active insiders")
29
- print(company.sic_description, company.state_of_incorporation)
30
-
31
- # Insider detail
32
- insider = client.insiders.get("0001234567")
33
- print(insider.name, insider.officer_title)
34
-
35
- # Cluster-buy signals (Business plan)
36
- signals = client.signals.list(cluster_buy=True)
37
- for sig in signals:
38
- print(sig.company_name, sig.insider_count, "buyers on", sig.signal_date)
39
- ```
40
-
41
- ## Async quickstart
42
-
43
- ```python
44
- import asyncio
45
- from form4api import AsyncForm4ApiClient
46
-
47
- async def main():
48
- async with AsyncForm4ApiClient("YOUR_API_KEY") as client:
49
- txns = await client.transactions.list(ticker="AAPL", per_page=5)
50
- for t in txns:
51
- print(t.insider_name, t.shares_amount, "@", t.price_per_share)
52
-
53
- asyncio.run(main())
54
- ```
55
-
56
- ## Resources
57
-
58
- | Resource | Methods |
59
- |---|---|
60
- | `client.transactions` | `.list(**params)`, `.paginate(**params)` |
61
- | `client.insiders` | `.search(name, **params)`, `.get(cik)`, `.transactions(cik, **params)` |
62
- | `client.companies` | `.get(ticker)`, `.insiders(ticker)` |
63
- | `client.signals` | `.list(**params)`, `.paginate(**params)` — Business plan |
64
- | `client.webhooks` | `.create(url, event_types)`, `.list()`, `.delete(id)`, `.events(**params)` |
65
-
66
- ### Not yet in this SDK
67
-
68
- The API surface is broader than the typed client. These backend features are **available via the REST API and the `form4api-mcp` server today, but don't have a typed SDK resource yet**:
69
-
70
- - **Form 144** notice-of-proposed-sale — `GET /v1/form144` *(Business)*
71
- - **Institutional holdings (13F-HR)** `GET /v1/holdings`, **managers** — `GET /v1/managers` *(Business)*
72
- - **Sentiment** (MSPR-style, 10b5-1-clean) — `GET /v1/signals/sentiment/{ticker}` *(Business)*
73
- - **Insider career summary** `GET /v1/insiders/{cik}/summary` *(Pro)*
74
- - **Post-trade returns** (1d/1w/1m/3m/6m) + `min_return_*` screening filters on `/v1/transactions` *(visible free; screening Pro)*
75
-
76
- Until they land in the SDK, call them directly (`client._get("/v1/holdings", {...})`) or see the [full REST reference](https://form4api.com/docs). For LLM workflows, `form4api-mcp` exposes all of the above as tools.
77
-
78
- ### Transaction filters
79
-
80
- ```python
81
- client.transactions.list(
82
- ticker="AAPL", # filter by ticker
83
- cik="0000320193", # or by company CIK
84
- insider_cik="...", # filter by insider CIK
85
- code="P", # transaction code: P=purchase, S=sale, A=grant, etc.
86
- from_date="2026-01-01",
87
- to_date="2026-12-31",
88
- exclude_10b5=True, # omit trades filed under a Rule 10b5-1 plan
89
- per_page=100,
90
- page=1,
91
- )
92
- ```
93
-
94
- ### Granular filtering (v0.4.0+)
95
-
96
- ```python
97
- # The "just show me real buys & sells" preset: open-market only,
98
- # no 10b5-1 plan trades, no derivatives.
99
- client.transactions.list(ticker="AAPL", significant=True)
100
-
101
- # Multi-code include / exclude (comma-separated SEC codes)
102
- client.transactions.list(codes="P,S")
103
- client.transactions.list(exclude_codes="A,M,F,G")
104
-
105
- # Whole-category filters: open_market | grants | derivatives | gifts | other
106
- client.transactions.list(category="open_market")
107
- client.transactions.list(exclude_category="derivatives")
108
- client.transactions.list(exclude_derivative=True)
109
-
110
- # Trade-size screening (Pro plan or higher)
111
- client.transactions.list(min_value=1_000_000) # USD, shares x price
112
- client.transactions.list(min_shares=10_000, max_shares=100_000)
113
- ```
114
-
115
- ### Transaction fields
116
-
117
- | Field | Type | Description |
118
- |-------|------|-------------|
119
- | `ticker` | `str` | Stock ticker |
120
- | `company_name` | `str` | Company name |
121
- | `insider_name` | `str` | Insider full name |
122
- | `insider_cik` | `str` | Insider CIK |
123
- | `insider_title` | `str \| None` | Officer title as reported on the Form 4 |
124
- | `is_director` | `bool` | Director flag |
125
- | `is_officer` | `bool` | Officer flag |
126
- | `is10_pct_owner` | `bool` | 10% owner flag |
127
- | `accession_number` | `str` | SEC accession number |
128
- | `security_title` | `str` | Security type |
129
- | `transaction_code` | `str` | Transaction code |
130
- | `is_open_market` | `bool` | `True` when code is P or S (not grants/awards) |
131
- | `is10b5_plan` | `bool` | Filed under a Rule 10b5-1 pre-scheduled trading plan |
132
- | `shares_amount` | `float` | Shares transacted |
133
- | `price_per_share` | `float \| None` | Price per share |
134
- | `total_value` | `float \| None` | `shares_amount × price_per_share` in USD |
135
- | `shares_owned_after` | `float \| None` | Holdings after transaction |
136
- | `direct_indirect` | `str \| None` | "D" (direct) or "I" (indirect) |
137
- | `is_derivative` | `bool` | Derivative security flag |
138
- | `transaction_date` | `str` | ISO datetime |
139
- | `period_of_report` | `str` | ISO datetime |
140
-
141
- ### Company fields
142
-
143
- | Field | Type | Description |
144
- |-------|------|-------------|
145
- | `cik` | `str` | SEC CIK |
146
- | `name` | `str` | Company name |
147
- | `ticker` | `str \| None` | Stock ticker |
148
- | `exchange` | `str \| None` | Exchange |
149
- | `total_filings` | `int` | Total Form 4 filings |
150
- | `active_insiders` | `int` | Distinct insiders who have filed |
151
- | `sic_description` | `str \| None` | SEC SIC industry description |
152
- | `state_of_incorporation` | `str \| None` | Two-letter state code |
153
- | `website` | `str \| None` | Company website as filed with SEC |
154
-
155
- ### Pagination
156
-
157
- ```python
158
- # transactions.paginate() yields one list per page automatically
159
- all_txns = []
160
- for batch in client.transactions.paginate(ticker="NVDA", exclude_10b5=True, per_page=500):
161
- all_txns.extend(batch)
162
-
163
- # signals.paginate()
164
- all_signals = []
165
- for batch in client.signals.paginate(cluster_buy=True, per_page=100):
166
- all_signals.extend(batch)
167
- ```
168
-
169
- ## Error handling
170
-
171
- ```python
172
- from form4api import Form4ApiClient, AuthError, PlanError, RateLimitError, NotFoundError
173
-
174
- client = Form4ApiClient("YOUR_API_KEY")
175
-
176
- try:
177
- signals = client.signals.list()
178
- except PlanError as e:
179
- print(f"Upgrade required")
180
- except RateLimitError as e:
181
- print(f"Retry after {e.retry_after}s")
182
- except AuthError:
183
- print("Invalid API key")
184
- except NotFoundError:
185
- print("Resource not found")
186
- ```
187
-
188
- ## License
189
-
190
- MIT
1
+ # form4api
2
+
3
+ Python client for [Form4API](https://www.form4api.com) — real-time SEC Form 4 insider trading data.
4
+
5
+ [![PyPI version](https://img.shields.io/pypi/v/form4api.svg)](https://pypi.org/project/form4api/)
6
+ [![PyPI downloads](https://img.shields.io/pypi/dm/form4api.svg)](https://pypi.org/project/form4api/)
7
+ [![Python versions](https://img.shields.io/pypi/pyversions/form4api.svg)](https://pypi.org/project/form4api/)
8
+ [![license](https://img.shields.io/pypi/l/form4api.svg)](https://github.com/theodor90/form4api-py/blob/main/LICENSE)
9
+
10
+ Supports Python 3.11+. Uses `httpx` for both sync and async HTTP.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ pip install form4api
16
+ ```
17
+
18
+ ## Sync quickstart
19
+
20
+ ```python
21
+ from form4api import Form4ApiClient
22
+
23
+ client = Form4ApiClient("YOUR_API_KEY")
24
+
25
+ # Recent open-market purchases at Apple (excluding 10b5-1 plan trades)
26
+ txns = client.transactions.list(ticker="AAPL", code="P", exclude_10b5=True, per_page=5)
27
+ for t in txns:
28
+ print(t.insider_name, t.insider_title, t.shares_amount, "@", t.price_per_share)
29
+ print(f" open market: {t.is_open_market}, 10b5 plan: {t.is10b5_plan}, value: ${t.total_value:,.0f}")
30
+
31
+ # Company overview (includes SIC, state, website)
32
+ company = client.companies.get("MSFT")
33
+ print(company.name, company.active_insiders, "active insiders")
34
+ print(company.sic_description, company.state_of_incorporation)
35
+
36
+ # Insider detail
37
+ insider = client.insiders.get("0001234567")
38
+ print(insider.name, insider.officer_title)
39
+
40
+ # Cluster-buy signals (Business plan)
41
+ signals = client.signals.list(cluster_buy=True)
42
+ for sig in signals:
43
+ print(sig.company_name, sig.insider_count, "buyers on", sig.signal_date)
44
+ ```
45
+
46
+ ## Async quickstart
47
+
48
+ ```python
49
+ import asyncio
50
+ from form4api import AsyncForm4ApiClient
51
+
52
+ async def main():
53
+ async with AsyncForm4ApiClient("YOUR_API_KEY") as client:
54
+ txns = await client.transactions.list(ticker="AAPL", per_page=5)
55
+ for t in txns:
56
+ print(t.insider_name, t.shares_amount, "@", t.price_per_share)
57
+
58
+ asyncio.run(main())
59
+ ```
60
+
61
+ ## Resources
62
+
63
+ | Resource | Methods |
64
+ |---|---|
65
+ | `client.transactions` | `.list(**params)`, `.paginate(**params)` |
66
+ | `client.insiders` | `.search(name, **params)`, `.get(cik)`, `.transactions(cik, **params)` |
67
+ | `client.companies` | `.get(ticker)`, `.insiders(ticker)` |
68
+ | `client.signals` | `.list(**params)`, `.paginate(**params)` Business plan |
69
+ | `client.webhooks` | `.create(url, event_types)`, `.list()`, `.delete(id)`, `.events(**params)` |
70
+
71
+ ### Not yet in this SDK
72
+
73
+ The API surface is broader than the typed client. These backend features are **available via the REST API and the `form4api-mcp` server today, but don't have a typed SDK resource yet**:
74
+
75
+ - **Form 144** notice-of-proposed-sale — `GET /v1/form144` *(Business)*
76
+ - **Institutional holdings (13F-HR)** `GET /v1/holdings`, **managers** `GET /v1/managers` *(Business)*
77
+ - **Sentiment** (MSPR-style, 10b5-1-clean) — `GET /v1/signals/sentiment/{ticker}` *(Business)*
78
+ - **Insider career summary** — `GET /v1/insiders/{cik}/summary` *(Pro)*
79
+ - **Post-trade returns** (1d/1w/1m/3m/6m) + `min_return_*` screening filters on `/v1/transactions` *(visible free; screening Pro)*
80
+
81
+ Until they land in the SDK, call them directly (`client._get("/v1/holdings", {...})`) or see the [full REST reference](https://form4api.com/docs). For LLM workflows, `form4api-mcp` exposes all of the above as tools.
82
+
83
+ ### Transaction filters
84
+
85
+ ```python
86
+ client.transactions.list(
87
+ ticker="AAPL", # filter by ticker
88
+ cik="0000320193", # or by company CIK
89
+ insider_cik="...", # filter by insider CIK
90
+ code="P", # transaction code: P=purchase, S=sale, A=grant, etc.
91
+ from_date="2026-01-01",
92
+ to_date="2026-12-31",
93
+ exclude_10b5=True, # omit trades filed under a Rule 10b5-1 plan
94
+ per_page=100,
95
+ page=1,
96
+ )
97
+ ```
98
+
99
+ ### Granular filtering (v0.4.0+)
100
+
101
+ ```python
102
+ # The "just show me real buys & sells" preset: open-market only,
103
+ # no 10b5-1 plan trades, no derivatives.
104
+ client.transactions.list(ticker="AAPL", significant=True)
105
+
106
+ # Multi-code include / exclude (comma-separated SEC codes)
107
+ client.transactions.list(codes="P,S")
108
+ client.transactions.list(exclude_codes="A,M,F,G")
109
+
110
+ # Whole-category filters: open_market | grants | derivatives | gifts | other
111
+ client.transactions.list(category="open_market")
112
+ client.transactions.list(exclude_category="derivatives")
113
+ client.transactions.list(exclude_derivative=True)
114
+
115
+ # Trade-size screening (Pro plan or higher)
116
+ client.transactions.list(min_value=1_000_000) # USD, shares x price
117
+ client.transactions.list(min_shares=10_000, max_shares=100_000)
118
+ ```
119
+
120
+ ### Transaction fields
121
+
122
+ | Field | Type | Description |
123
+ |-------|------|-------------|
124
+ | `ticker` | `str` | Stock ticker |
125
+ | `company_name` | `str` | Company name |
126
+ | `insider_name` | `str` | Insider full name |
127
+ | `insider_cik` | `str` | Insider CIK |
128
+ | `insider_title` | `str \| None` | Officer title as reported on the Form 4 |
129
+ | `is_director` | `bool` | Director flag |
130
+ | `is_officer` | `bool` | Officer flag |
131
+ | `is10_pct_owner` | `bool` | 10% owner flag |
132
+ | `accession_number` | `str` | SEC accession number |
133
+ | `security_title` | `str` | Security type |
134
+ | `transaction_code` | `str` | Transaction code |
135
+ | `is_open_market` | `bool` | `True` when code is P or S (not grants/awards) |
136
+ | `is10b5_plan` | `bool` | Filed under a Rule 10b5-1 pre-scheduled trading plan |
137
+ | `shares_amount` | `float` | Shares transacted |
138
+ | `price_per_share` | `float \| None` | Price per share |
139
+ | `total_value` | `float \| None` | `shares_amount × price_per_share` in USD |
140
+ | `shares_owned_after` | `float \| None` | Holdings after transaction |
141
+ | `direct_indirect` | `str \| None` | "D" (direct) or "I" (indirect) |
142
+ | `is_derivative` | `bool` | Derivative security flag |
143
+ | `transaction_date` | `str` | ISO datetime |
144
+ | `period_of_report` | `str` | ISO datetime |
145
+
146
+ ### Company fields
147
+
148
+ | Field | Type | Description |
149
+ |-------|------|-------------|
150
+ | `cik` | `str` | SEC CIK |
151
+ | `name` | `str` | Company name |
152
+ | `ticker` | `str \| None` | Stock ticker |
153
+ | `exchange` | `str \| None` | Exchange |
154
+ | `total_filings` | `int` | Total Form 4 filings |
155
+ | `active_insiders` | `int` | Distinct insiders who have filed |
156
+ | `sic_description` | `str \| None` | SEC SIC industry description |
157
+ | `state_of_incorporation` | `str \| None` | Two-letter state code |
158
+ | `website` | `str \| None` | Company website as filed with SEC |
159
+
160
+ ### Pagination
161
+
162
+ ```python
163
+ # transactions.paginate() — yields one list per page automatically
164
+ all_txns = []
165
+ for batch in client.transactions.paginate(ticker="NVDA", exclude_10b5=True, per_page=500):
166
+ all_txns.extend(batch)
167
+
168
+ # signals.paginate()
169
+ all_signals = []
170
+ for batch in client.signals.paginate(cluster_buy=True, per_page=100):
171
+ all_signals.extend(batch)
172
+ ```
173
+
174
+ ## Error handling
175
+
176
+ ```python
177
+ from form4api import Form4ApiClient, AuthError, PlanError, RateLimitError, NotFoundError
178
+
179
+ client = Form4ApiClient("YOUR_API_KEY")
180
+
181
+ try:
182
+ signals = client.signals.list()
183
+ except PlanError as e:
184
+ print(f"Upgrade required")
185
+ except RateLimitError as e:
186
+ print(f"Retry after {e.retry_after}s")
187
+ except AuthError:
188
+ print("Invalid API key")
189
+ except NotFoundError:
190
+ print("Resource not found")
191
+ ```
192
+
193
+ ## License
194
+
195
+ MIT
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: form4api
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Python client for the Form4API — real-time SEC Form 4 insider trading data
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://www.form4api.com
7
7
  Project-URL: Documentation, https://www.form4api.com/docs
8
8
  Project-URL: Repository, https://github.com/theodor90/form4api-py.git
9
+ Keywords: insider-trading,sec,sec-edgar,edgar,form-4,form4,form-144,13f,13f-hr,financial-data,stock-market,stocks,fintech,api,sdk,webhooks,form4api
9
10
  Requires-Python: >=3.11
10
11
  Description-Content-Type: text/markdown
11
12
  License-File: LICENSE
@@ -18,7 +19,12 @@ Dynamic: license-file
18
19
 
19
20
  # form4api
20
21
 
21
- Python client for [Form4API](https://form4api.com) — real-time SEC Form 4 insider trading data.
22
+ Python client for [Form4API](https://www.form4api.com) — real-time SEC Form 4 insider trading data.
23
+
24
+ [![PyPI version](https://img.shields.io/pypi/v/form4api.svg)](https://pypi.org/project/form4api/)
25
+ [![PyPI downloads](https://img.shields.io/pypi/dm/form4api.svg)](https://pypi.org/project/form4api/)
26
+ [![Python versions](https://img.shields.io/pypi/pyversions/form4api.svg)](https://pypi.org/project/form4api/)
27
+ [![license](https://img.shields.io/pypi/l/form4api.svg)](https://github.com/theodor90/form4api-py/blob/main/LICENSE)
22
28
 
23
29
  Supports Python 3.11+. Uses `httpx` for both sync and async HTTP.
24
30
 
@@ -4,8 +4,9 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "form4api"
7
- version = "0.4.1"
7
+ version = "0.4.2"
8
8
  description = "Python client for the Form4API — real-time SEC Form 4 insider trading data"
9
+ keywords = ["insider-trading", "sec", "sec-edgar", "edgar", "form-4", "form4", "form-144", "13f", "13f-hr", "financial-data", "stock-market", "stocks", "fintech", "api", "sdk", "webhooks", "form4api"]
9
10
  requires-python = ">=3.11"
10
11
  dependencies = ["httpx>=0.27"]
11
12
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes