apiverve-cashflowstatement 1.2.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.
- apiverve_cashflowstatement-1.2.2/LICENSE +21 -0
- apiverve_cashflowstatement-1.2.2/PKG-INFO +337 -0
- apiverve_cashflowstatement-1.2.2/README.md +313 -0
- apiverve_cashflowstatement-1.2.2/pyproject.toml +29 -0
- apiverve_cashflowstatement-1.2.2/setup.cfg +4 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement/__init__.py +3 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement/apiClient.py +252 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement/exceptions.py +3 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement/setup.py +26 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement/setup_dep.py +21 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement/tests/__init__.py +1 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement/tests/test_api.py +19 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement.egg-info/PKG-INFO +337 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement.egg-info/SOURCES.txt +16 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement.egg-info/dependency_links.txt +1 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement.egg-info/requires.txt +1 -0
- apiverve_cashflowstatement-1.2.2/src/apiverve_cashflowstatement.egg-info/top_level.txt +1 -0
- apiverve_cashflowstatement-1.2.2/tests/test_api.py +27 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 APIVerve and EvlarSoft LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: apiverve-cashflowstatement
|
|
3
|
+
Version: 1.2.2
|
|
4
|
+
Summary: Cash Flow Statement returns operating, investing and financing cash flows for a US public company by ticker - straight from SEC filings, with free cash flow, FCF margin and cash-conversion metrics calculated for you.
|
|
5
|
+
Author-email: APIVerve <hello@apiverve.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://apiverve.com/marketplace/cashflow?utm_source=pypi&utm_medium=referral&utm_content=homepage
|
|
8
|
+
Project-URL: Documentation, https://docs.apiverve.com/ref/cashflow?utm_source=pypi&utm_medium=referral&utm_content=docs
|
|
9
|
+
Project-URL: Repository, https://github.com/apiverve/cashflow-api
|
|
10
|
+
Project-URL: Twitter, https://twitter.com/apivervehq
|
|
11
|
+
Keywords: cash flow api,cash flow statement api,free cash flow api,fcf api,operating cash flow api
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: Natural Language :: English
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: requests>=2.25.0
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
Cash Flow Statement API
|
|
26
|
+
============
|
|
27
|
+
|
|
28
|
+
Cash Flow Statement returns operating, investing and financing cash flows for a US public company by ticker - straight from SEC filings, with free cash flow, FCF margin and cash-conversion metrics calculated for you.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/apiverve-cashflowstatement/)
|
|
32
|
+
|
|
33
|
+
This is a Python wrapper for the [Cash Flow Statement API](https://apiverve.com/marketplace/cashflow?utm_source=pypi&utm_medium=referral&utm_content=readme)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Using `pip`:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install apiverve-cashflowstatement
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Using `pip3`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip3 install apiverve-cashflowstatement
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
Before using the Cash Flow Statement API client, you have to setup your account and obtain your API Key.
|
|
56
|
+
You can get it by signing up at [https://apiverve.com](https://apiverve.com?utm_source=pypi&utm_medium=referral&utm_content=readme)
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
Here's a simple example to get you started quickly:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
66
|
+
|
|
67
|
+
# Initialize the client with your APIVerve API key
|
|
68
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
69
|
+
|
|
70
|
+
query = {
|
|
71
|
+
"ticker": "AAPL",
|
|
72
|
+
"year": 0,
|
|
73
|
+
"quarter": 0
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
# Make the API call
|
|
78
|
+
result = api.execute(query)
|
|
79
|
+
|
|
80
|
+
# Print the result
|
|
81
|
+
print(result)
|
|
82
|
+
except Exception as e:
|
|
83
|
+
print(f"Error: {e}")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Usage
|
|
89
|
+
|
|
90
|
+
The Cash Flow Statement API documentation is found here: [https://docs.apiverve.com/ref/cashflow](https://docs.apiverve.com/ref/cashflow?utm_source=pypi&utm_medium=referral&utm_content=readme).
|
|
91
|
+
You can find parameters, example responses, and status codes documented here.
|
|
92
|
+
|
|
93
|
+
### Setup
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
# Import the client module
|
|
97
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
98
|
+
|
|
99
|
+
# Initialize the client with your APIVerve API key
|
|
100
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Perform Request
|
|
106
|
+
|
|
107
|
+
Using the API client, you can perform requests to the API.
|
|
108
|
+
|
|
109
|
+
###### Define Query
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
query = {
|
|
113
|
+
"ticker": "AAPL",
|
|
114
|
+
"year": 0,
|
|
115
|
+
"quarter": 0
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
###### Simple Request
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
# Make a request to the API
|
|
123
|
+
result = api.execute(query)
|
|
124
|
+
|
|
125
|
+
# Print the result
|
|
126
|
+
print(result)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
###### Example Response
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"status": "ok",
|
|
134
|
+
"error": null,
|
|
135
|
+
"data": {
|
|
136
|
+
"ticker": "AAPL",
|
|
137
|
+
"company": "Apple Inc.",
|
|
138
|
+
"cik": "0000320193",
|
|
139
|
+
"fiscalYear": 2025,
|
|
140
|
+
"fiscalQuarter": 4,
|
|
141
|
+
"filingType": "10-K",
|
|
142
|
+
"filingDate": "2025-10-31",
|
|
143
|
+
"periodEnd": "2025-09-27",
|
|
144
|
+
"cashFlow": {
|
|
145
|
+
"operatingCashFlow": 111482000000,
|
|
146
|
+
"capitalExpenditures": 12715000000,
|
|
147
|
+
"investingCashFlow": 15195000000,
|
|
148
|
+
"financingCashFlow": -120686000000,
|
|
149
|
+
"dividendsPaid": 15421000000,
|
|
150
|
+
"shareRepurchases": 90711000000,
|
|
151
|
+
"freeCashFlow": 98767000000
|
|
152
|
+
},
|
|
153
|
+
"metrics": {
|
|
154
|
+
"fcfMargin": 23.73,
|
|
155
|
+
"operatingCashFlowMargin": 26.79,
|
|
156
|
+
"capexToRevenue": 3.06,
|
|
157
|
+
"cashFlowToNetIncome": 1,
|
|
158
|
+
"dividendPayoutRatio": 13.77,
|
|
159
|
+
"fcfPerShare": 6.5824
|
|
160
|
+
},
|
|
161
|
+
"formatted": {
|
|
162
|
+
"operatingCashFlow": "$111.48B",
|
|
163
|
+
"freeCashFlow": "$98.77B",
|
|
164
|
+
"capitalExpenditures": "$12.71B"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Error Handling
|
|
173
|
+
|
|
174
|
+
The API client provides comprehensive error handling through the `CashflowAPIClientError` exception. Here are some examples:
|
|
175
|
+
|
|
176
|
+
### Basic Error Handling
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient, CashflowAPIClientError
|
|
180
|
+
|
|
181
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
182
|
+
|
|
183
|
+
query = {
|
|
184
|
+
"ticker": "AAPL",
|
|
185
|
+
"year": 0,
|
|
186
|
+
"quarter": 0
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
try:
|
|
190
|
+
result = api.execute(query)
|
|
191
|
+
print("Success!")
|
|
192
|
+
print(result)
|
|
193
|
+
except CashflowAPIClientError as e:
|
|
194
|
+
print(f"API Error: {e.message}")
|
|
195
|
+
if e.status_code:
|
|
196
|
+
print(f"Status Code: {e.status_code}")
|
|
197
|
+
if e.response:
|
|
198
|
+
print(f"Response: {e.response}")
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Handling Specific Error Types
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient, CashflowAPIClientError
|
|
205
|
+
|
|
206
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
207
|
+
|
|
208
|
+
query = {
|
|
209
|
+
"ticker": "AAPL",
|
|
210
|
+
"year": 0,
|
|
211
|
+
"quarter": 0
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
try:
|
|
215
|
+
result = api.execute(query)
|
|
216
|
+
|
|
217
|
+
# Check for successful response
|
|
218
|
+
if result.get('status') == 'success':
|
|
219
|
+
print("Request successful!")
|
|
220
|
+
print(result.get('data'))
|
|
221
|
+
else:
|
|
222
|
+
print(f"API returned an error: {result.get('error')}")
|
|
223
|
+
|
|
224
|
+
except CashflowAPIClientError as e:
|
|
225
|
+
# Handle API client errors
|
|
226
|
+
if e.status_code == 401:
|
|
227
|
+
print("Unauthorized: Invalid API key")
|
|
228
|
+
elif e.status_code == 429:
|
|
229
|
+
print("Rate limit exceeded")
|
|
230
|
+
elif e.status_code >= 500:
|
|
231
|
+
print("Server error - please try again later")
|
|
232
|
+
else:
|
|
233
|
+
print(f"API error: {e.message}")
|
|
234
|
+
except Exception as e:
|
|
235
|
+
# Handle unexpected errors
|
|
236
|
+
print(f"Unexpected error: {str(e)}")
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Using Context Manager (Recommended)
|
|
240
|
+
|
|
241
|
+
The client supports the context manager protocol for automatic resource cleanup:
|
|
242
|
+
|
|
243
|
+
```python
|
|
244
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient, CashflowAPIClientError
|
|
245
|
+
|
|
246
|
+
query = {
|
|
247
|
+
"ticker": "AAPL",
|
|
248
|
+
"year": 0,
|
|
249
|
+
"quarter": 0
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
# Using context manager ensures proper cleanup
|
|
253
|
+
with CashflowAPIClient("[YOUR_API_KEY]") as api:
|
|
254
|
+
try:
|
|
255
|
+
result = api.execute(query)
|
|
256
|
+
print(result)
|
|
257
|
+
except CashflowAPIClientError as e:
|
|
258
|
+
print(f"Error: {e.message}")
|
|
259
|
+
# Session is automatically closed here
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Advanced Features
|
|
265
|
+
|
|
266
|
+
### Debug Mode
|
|
267
|
+
|
|
268
|
+
Enable debug logging to see detailed request and response information:
|
|
269
|
+
|
|
270
|
+
```python
|
|
271
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
272
|
+
|
|
273
|
+
# Enable debug mode
|
|
274
|
+
api = CashflowAPIClient("[YOUR_API_KEY]", debug=True)
|
|
275
|
+
|
|
276
|
+
query = {
|
|
277
|
+
"ticker": "AAPL",
|
|
278
|
+
"year": 0,
|
|
279
|
+
"quarter": 0
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
# Debug information will be printed to console
|
|
283
|
+
result = api.execute(query)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Manual Session Management
|
|
287
|
+
|
|
288
|
+
If you need to manually manage the session lifecycle:
|
|
289
|
+
|
|
290
|
+
```python
|
|
291
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
292
|
+
|
|
293
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
294
|
+
|
|
295
|
+
query = {
|
|
296
|
+
"ticker": "AAPL",
|
|
297
|
+
"year": 0,
|
|
298
|
+
"quarter": 0
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
try:
|
|
302
|
+
result = api.execute(query)
|
|
303
|
+
print(result)
|
|
304
|
+
finally:
|
|
305
|
+
# Manually close the session when done
|
|
306
|
+
api.close()
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## Customer Support
|
|
312
|
+
|
|
313
|
+
Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact?utm_source=pypi&utm_medium=referral&utm_content=readme).
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Updates
|
|
318
|
+
Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Legal
|
|
323
|
+
|
|
324
|
+
All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms?utm_source=pypi&utm_medium=referral&utm_content=readme) and all legal documents and agreements.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## License
|
|
329
|
+
Licensed under the MIT License (MIT)
|
|
330
|
+
|
|
331
|
+
Copyright (©) 2026 APIVerve, and EvlarSoft LLC
|
|
332
|
+
|
|
333
|
+
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:
|
|
334
|
+
|
|
335
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
336
|
+
|
|
337
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
Cash Flow Statement API
|
|
2
|
+
============
|
|
3
|
+
|
|
4
|
+
Cash Flow Statement returns operating, investing and financing cash flows for a US public company by ticker - straight from SEC filings, with free cash flow, FCF margin and cash-conversion metrics calculated for you.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/apiverve-cashflowstatement/)
|
|
8
|
+
|
|
9
|
+
This is a Python wrapper for the [Cash Flow Statement API](https://apiverve.com/marketplace/cashflow?utm_source=pypi&utm_medium=referral&utm_content=readme)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Using `pip`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install apiverve-cashflowstatement
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Using `pip3`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip3 install apiverve-cashflowstatement
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Configuration
|
|
30
|
+
|
|
31
|
+
Before using the Cash Flow Statement API client, you have to setup your account and obtain your API Key.
|
|
32
|
+
You can get it by signing up at [https://apiverve.com](https://apiverve.com?utm_source=pypi&utm_medium=referral&utm_content=readme)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
Here's a simple example to get you started quickly:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
42
|
+
|
|
43
|
+
# Initialize the client with your APIVerve API key
|
|
44
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
45
|
+
|
|
46
|
+
query = {
|
|
47
|
+
"ticker": "AAPL",
|
|
48
|
+
"year": 0,
|
|
49
|
+
"quarter": 0
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
# Make the API call
|
|
54
|
+
result = api.execute(query)
|
|
55
|
+
|
|
56
|
+
# Print the result
|
|
57
|
+
print(result)
|
|
58
|
+
except Exception as e:
|
|
59
|
+
print(f"Error: {e}")
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
The Cash Flow Statement API documentation is found here: [https://docs.apiverve.com/ref/cashflow](https://docs.apiverve.com/ref/cashflow?utm_source=pypi&utm_medium=referral&utm_content=readme).
|
|
67
|
+
You can find parameters, example responses, and status codes documented here.
|
|
68
|
+
|
|
69
|
+
### Setup
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
# Import the client module
|
|
73
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
74
|
+
|
|
75
|
+
# Initialize the client with your APIVerve API key
|
|
76
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Perform Request
|
|
82
|
+
|
|
83
|
+
Using the API client, you can perform requests to the API.
|
|
84
|
+
|
|
85
|
+
###### Define Query
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
query = {
|
|
89
|
+
"ticker": "AAPL",
|
|
90
|
+
"year": 0,
|
|
91
|
+
"quarter": 0
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
###### Simple Request
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
# Make a request to the API
|
|
99
|
+
result = api.execute(query)
|
|
100
|
+
|
|
101
|
+
# Print the result
|
|
102
|
+
print(result)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
###### Example Response
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"status": "ok",
|
|
110
|
+
"error": null,
|
|
111
|
+
"data": {
|
|
112
|
+
"ticker": "AAPL",
|
|
113
|
+
"company": "Apple Inc.",
|
|
114
|
+
"cik": "0000320193",
|
|
115
|
+
"fiscalYear": 2025,
|
|
116
|
+
"fiscalQuarter": 4,
|
|
117
|
+
"filingType": "10-K",
|
|
118
|
+
"filingDate": "2025-10-31",
|
|
119
|
+
"periodEnd": "2025-09-27",
|
|
120
|
+
"cashFlow": {
|
|
121
|
+
"operatingCashFlow": 111482000000,
|
|
122
|
+
"capitalExpenditures": 12715000000,
|
|
123
|
+
"investingCashFlow": 15195000000,
|
|
124
|
+
"financingCashFlow": -120686000000,
|
|
125
|
+
"dividendsPaid": 15421000000,
|
|
126
|
+
"shareRepurchases": 90711000000,
|
|
127
|
+
"freeCashFlow": 98767000000
|
|
128
|
+
},
|
|
129
|
+
"metrics": {
|
|
130
|
+
"fcfMargin": 23.73,
|
|
131
|
+
"operatingCashFlowMargin": 26.79,
|
|
132
|
+
"capexToRevenue": 3.06,
|
|
133
|
+
"cashFlowToNetIncome": 1,
|
|
134
|
+
"dividendPayoutRatio": 13.77,
|
|
135
|
+
"fcfPerShare": 6.5824
|
|
136
|
+
},
|
|
137
|
+
"formatted": {
|
|
138
|
+
"operatingCashFlow": "$111.48B",
|
|
139
|
+
"freeCashFlow": "$98.77B",
|
|
140
|
+
"capitalExpenditures": "$12.71B"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Error Handling
|
|
149
|
+
|
|
150
|
+
The API client provides comprehensive error handling through the `CashflowAPIClientError` exception. Here are some examples:
|
|
151
|
+
|
|
152
|
+
### Basic Error Handling
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient, CashflowAPIClientError
|
|
156
|
+
|
|
157
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
158
|
+
|
|
159
|
+
query = {
|
|
160
|
+
"ticker": "AAPL",
|
|
161
|
+
"year": 0,
|
|
162
|
+
"quarter": 0
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
try:
|
|
166
|
+
result = api.execute(query)
|
|
167
|
+
print("Success!")
|
|
168
|
+
print(result)
|
|
169
|
+
except CashflowAPIClientError as e:
|
|
170
|
+
print(f"API Error: {e.message}")
|
|
171
|
+
if e.status_code:
|
|
172
|
+
print(f"Status Code: {e.status_code}")
|
|
173
|
+
if e.response:
|
|
174
|
+
print(f"Response: {e.response}")
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Handling Specific Error Types
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient, CashflowAPIClientError
|
|
181
|
+
|
|
182
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
183
|
+
|
|
184
|
+
query = {
|
|
185
|
+
"ticker": "AAPL",
|
|
186
|
+
"year": 0,
|
|
187
|
+
"quarter": 0
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
try:
|
|
191
|
+
result = api.execute(query)
|
|
192
|
+
|
|
193
|
+
# Check for successful response
|
|
194
|
+
if result.get('status') == 'success':
|
|
195
|
+
print("Request successful!")
|
|
196
|
+
print(result.get('data'))
|
|
197
|
+
else:
|
|
198
|
+
print(f"API returned an error: {result.get('error')}")
|
|
199
|
+
|
|
200
|
+
except CashflowAPIClientError as e:
|
|
201
|
+
# Handle API client errors
|
|
202
|
+
if e.status_code == 401:
|
|
203
|
+
print("Unauthorized: Invalid API key")
|
|
204
|
+
elif e.status_code == 429:
|
|
205
|
+
print("Rate limit exceeded")
|
|
206
|
+
elif e.status_code >= 500:
|
|
207
|
+
print("Server error - please try again later")
|
|
208
|
+
else:
|
|
209
|
+
print(f"API error: {e.message}")
|
|
210
|
+
except Exception as e:
|
|
211
|
+
# Handle unexpected errors
|
|
212
|
+
print(f"Unexpected error: {str(e)}")
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Using Context Manager (Recommended)
|
|
216
|
+
|
|
217
|
+
The client supports the context manager protocol for automatic resource cleanup:
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient, CashflowAPIClientError
|
|
221
|
+
|
|
222
|
+
query = {
|
|
223
|
+
"ticker": "AAPL",
|
|
224
|
+
"year": 0,
|
|
225
|
+
"quarter": 0
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
# Using context manager ensures proper cleanup
|
|
229
|
+
with CashflowAPIClient("[YOUR_API_KEY]") as api:
|
|
230
|
+
try:
|
|
231
|
+
result = api.execute(query)
|
|
232
|
+
print(result)
|
|
233
|
+
except CashflowAPIClientError as e:
|
|
234
|
+
print(f"Error: {e.message}")
|
|
235
|
+
# Session is automatically closed here
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Advanced Features
|
|
241
|
+
|
|
242
|
+
### Debug Mode
|
|
243
|
+
|
|
244
|
+
Enable debug logging to see detailed request and response information:
|
|
245
|
+
|
|
246
|
+
```python
|
|
247
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
248
|
+
|
|
249
|
+
# Enable debug mode
|
|
250
|
+
api = CashflowAPIClient("[YOUR_API_KEY]", debug=True)
|
|
251
|
+
|
|
252
|
+
query = {
|
|
253
|
+
"ticker": "AAPL",
|
|
254
|
+
"year": 0,
|
|
255
|
+
"quarter": 0
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
# Debug information will be printed to console
|
|
259
|
+
result = api.execute(query)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Manual Session Management
|
|
263
|
+
|
|
264
|
+
If you need to manually manage the session lifecycle:
|
|
265
|
+
|
|
266
|
+
```python
|
|
267
|
+
from apiverve_cashflowstatement.apiClient import CashflowAPIClient
|
|
268
|
+
|
|
269
|
+
api = CashflowAPIClient("[YOUR_API_KEY]")
|
|
270
|
+
|
|
271
|
+
query = {
|
|
272
|
+
"ticker": "AAPL",
|
|
273
|
+
"year": 0,
|
|
274
|
+
"quarter": 0
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
try:
|
|
278
|
+
result = api.execute(query)
|
|
279
|
+
print(result)
|
|
280
|
+
finally:
|
|
281
|
+
# Manually close the session when done
|
|
282
|
+
api.close()
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Customer Support
|
|
288
|
+
|
|
289
|
+
Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact?utm_source=pypi&utm_medium=referral&utm_content=readme).
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Updates
|
|
294
|
+
Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Legal
|
|
299
|
+
|
|
300
|
+
All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms?utm_source=pypi&utm_medium=referral&utm_content=readme) and all legal documents and agreements.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## License
|
|
305
|
+
Licensed under the MIT License (MIT)
|
|
306
|
+
|
|
307
|
+
Copyright (©) 2026 APIVerve, and EvlarSoft LLC
|
|
308
|
+
|
|
309
|
+
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:
|
|
310
|
+
|
|
311
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
312
|
+
|
|
313
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "apiverve-cashflowstatement"
|
|
3
|
+
version = "1.2.2"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name="APIVerve", email="hello@apiverve.com" },
|
|
6
|
+
]
|
|
7
|
+
description = "Cash Flow Statement returns operating, investing and financing cash flows for a US public company by ticker - straight from SEC filings, with free cash flow, FCF margin and cash-conversion metrics calculated for you."
|
|
8
|
+
keywords = ["cash flow api", "cash flow statement api", "free cash flow api", "fcf api", "operating cash flow api"]
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
dependencies = [
|
|
13
|
+
"requests>=2.25.0"
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 5 - Production/Stable",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Topic :: Internet :: WWW/HTTP",
|
|
21
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
22
|
+
"Natural Language :: English",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://apiverve.com/marketplace/cashflow?utm_source=pypi&utm_medium=referral&utm_content=homepage"
|
|
27
|
+
Documentation = "https://docs.apiverve.com/ref/cashflow?utm_source=pypi&utm_medium=referral&utm_content=docs"
|
|
28
|
+
Repository = "https://github.com/apiverve/cashflow-api"
|
|
29
|
+
Twitter = "https://twitter.com/apivervehq"
|