Skip to content

Commit 701084f

Browse files
committed
cleanup
1 parent 0232c32 commit 701084f

8 files changed

+158
-138
lines changed

.gitignore

+9-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
__pycache__/
33
*.py[cod]
44
*$py.class
5-
configAlex.py
6-
clientportal.gw/
7-
clientportal.beta.gw/
8-
alex/
9-
config/
105

116
# C extensions
127
*.so
@@ -132,6 +127,13 @@ dmypy.json
132127

133128
# Pyre type checker
134129
.pyre/
135-
.vscode/settings.json
136-
curl.txt
130+
131+
# Add files that I don't want on GitHub.
132+
.vscode/
137133
ibw/server_session.json
134+
.pypirc
135+
MANIFEST.in
136+
clientportal.gw/
137+
clientportal.beta.gw/
138+
alex/
139+
config/

README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ The API does not require any API keys to use it, all of the authentication is ha
5555

5656
## Setup Installation
5757

58-
PLACE HOLDER FOR PIP INSTALLATION
58+
```console
59+
pip install interactive-broker-python-web-api
60+
```
5961

6062
## Setup Writing Account Information
6163

@@ -71,18 +73,22 @@ To create a config file using hte `configparser` module, run the script below in
7173
import pathlib
7274
from configparser import ConfigParser
7375

76+
# Initialize a new instance of the `ConfigParser` object.
7477
config = ConfigParser()
7578

79+
# Define a new section called `main`.
7680
config.add_section('main')
7781

82+
# Set the values for the `main` section.
7883
config.set('main', 'REGULAR_ACCOUNT', 'YOUR_ACCOUNT_NUMBER')
7984
config.set('main', 'REGULAR_USERNAME', 'YOUR_ACCOUNT_USERNAME')
80-
8185
config.set('main', 'PAPER_ACCOUNT', 'YOUR_ACCOUNT_NUMBER')
8286
config.set('main', 'PAPER_USERNAME', 'YOUR_ACCOUNT_USERNAME')
8387

88+
# Make the `config` folder for the user.
8489
new_directory = pathlib.Path("config/").mkdir(parents=True, exist_ok=True)
8590

91+
# Write the contents of the `ConfigParser` object to the `config.ini` file.
8692
with open('config/config.ini', 'w+') as f:
8793
config.write(f)
8894
```
@@ -129,9 +135,15 @@ ib_client.close_session()
129135

130136
For certain requests, in a limited fashion, it will help validate your request when possible. For example, when grabbing real-time quotes using the `market_data` endpoint, it will validate the fields you request to ensure they're valid fields for that endpoint.
131137

132-
## Documentation and Resources
138+
### Endpoint Verification
139+
140+
To use certain endpoints, you must call other endpoints before you use it. To help limit the amount of confusion for users, the library will call those endpoints for you behind the scenes so that way you don't need to worry about it.
133141

134-
### Official API Documentation
142+
### Client Portal Download
143+
144+
If the user doesn't have the clientportal gateway downloaded, then the library will download a copy it, unzip it for you, and quickly allow you to get up and running with your scripts.
145+
146+
## Documentation and Resources
135147

136148
- [Getting Started](https://interactivebrokers.github.io/cpwebapi/index.html#login)
137149
- [Endpoints](https://interactivebrokers.com/api/doc.html)
@@ -146,4 +158,4 @@ Help support this project and future projects by donating to my [Patreon Page](h
146158
If you'd like to watch more of my content, feel free to visit my YouTube channel [Sigma Coding](https://www.youtube.com/c/SigmaCoding).
147159

148160
**Hire Me:**
149-
If you have a project, you think I can help you with feel free to reach out at [[email protected]](mailto:[email protected]?subject=[GitHub]%20Project%20Proposal) or fill out the [contract request form](https://forms.office.com/Pages/ResponsePage.aspx?id=ZwOBErInsUGliXx0Yo2VfcCSWZSwW25Es3vPV2veU0pUMUs5MUc2STkzSzVQMFNDVlI5NjJVNjREUi4u)
161+
If you have a project, you think I can help you with feel free to reach out at [[email protected]](mailto:[email protected]?subject=[GitHub]%20Project%20Proposal) or fill out the [contract request form](https://forms.office.com/Pages/ResponsePage.aspx?id=DQSIkWdsW0yxEjajBLZtrQAAAAAAAAAAAAa__aAmF1hURFg5ODdaVTg1TldFVUhDVjJHWlRWRzhZRy4u)

resources/clientportal.beta.gw.zip

-10.3 MB
Binary file not shown.

resources/clientportal.gw.zip

-10.3 MB
Binary file not shown.
File renamed without changes.

resources/ibw_library_installation.md

-84
This file was deleted.
+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Interactive Brokers Undocumented Endpoints
2+
3+
## News Data
4+
5+
<https://cdcdyn.interactivebrokers.com/portal.proxy/v1/portal/iserver/news/briefing>
6+
<https://cdcdyn.interactivebrokers.com/portal.proxy/v1/portal/iserver/news/sources>
7+
<https://cdcdyn.interactivebrokers.com/portal.proxy/v1/portal/iserver/news/top>
8+
<https://cdcdyn.interactivebrokers.com/portal.proxy/v1/portal/iserver/news/portfolio>
9+
<https://localhost:5000/v1/portal/fundamentals/landing/265598?widgets=news&lang=en>
10+
11+
## Ratios
12+
13+
<https://localhost:5000/v1/portal/fundamentals/ratio_details/265598?search_id=C|PENORM,LAST_DAY,0>
14+
<https://localhost:5000/v1/portal/fundamentals/ratio_details/265598?search_id=C|PR2TANBK,LAST_DAY,0,((C|TANBVPS,LFI,0))>
15+
<https://localhost:5000/v1/portal/fundamentals/ratio_details/265598?search_id=C|GROSMGN,TTM,0>
16+
17+
## Tip Ranks
18+
19+
<https://widgets.tipranks.com/api/IB/analystratings?ticker=AAPL>
20+
<https://widgets.tipranks.com/api/IB/news?ticker=AAPL>
21+
<https://widgets.tipranks.com/api/IB/prices?ticker=AAPL>
22+
23+
## Analyst Forecast
24+
25+
<https://localhost:5000/v1/portal/fundamentals/analyst_forecasts/265598?annual=false&all=true>
26+
27+
## Persist
28+
29+
<https://localhost:5000/v1/portal/fundamentals/persist/search/265598>
30+
31+
## Fundamentals Data
32+
33+
<https://localhost:5000/v1/portal/fundamentals/mf_lip_ratings/10753238>
34+
<https://localhost:5000/v1/portal/fundamentals/mf_performance_chart/10753238?chart_period=3M>
35+
<https://localhost:5000/v1/portal/fundamentals/mf_holdings/10753238>
36+
<https://localhost:5000/v1/portal/fundamentals/mf_ratios_fundamentals/10753238>
37+
<https://localhost:5000/v1/portal/fundamentals/mf_risks_stats/10753238?period=1Y>
38+
<https://localhost:5000/v1/portal/fundamentals/mf_esg/10753238>
39+
<https://localhost:5000/v1/portal/fundamentals/ownership/10753238>
40+
<https://localhost:5000/v1/portal/fundamentals/dividends/10753238>
41+
<https://localhost:5000/v1/portal/fundamentals/research/altavista/10753238>
42+
<https://localhost:5000/v1/portal/fundamentals/landing/10753238>
43+
44+
## Metrics Reporting
45+
46+
<https://cdcdyn.interactivebrokers.com/portal.proxy/v1/portal/metrics/report>
47+
48+
## Scanners
49+
50+
<https://cdcdyn.interactivebrokers.com/portal.proxy/v1/mkt/hmds/scanner>
51+
52+
## 1-Minute Historical Data
53+
54+
<https://localhost:5000/v1/portal/iserver/marketdata/history?conid=265598&period=2h&bar=1min>
55+
<https://localhost:5000/v1/portal/iserver/marketdata/history?conid=111710390&period=1m&source=m&bar=4h>
56+
57+
## Options Contracts - Info
58+
59+
<https://localhost:5000/v1/portal/iserver/secdef/info?conid=265598&sectype=OPT&month=MAR20&exchange=SMART&strike=297.5&right=P>
60+
<https://localhost:5000/v1/portal/iserver/secdef/info?conid=265598&sectype=OPT&month=MAR20&exchange=SMART&strike=297.5&right=C>
61+
62+
## Options Contracts - Strikes
63+
64+
<https://localhost:5000/v1/portal/iserver/secdef/strikes?conid=265598&sectype=OPT&month=MAR20&exchange=SMART>
65+
66+
## Bonds - Info
67+
68+
<https://localhost:5000/v1/portal/iserver/secdef/info?symbol=CL&issuerId=e1377044&sectype=BOND&filters=0:SMART,27:202109>
69+
70+
## Params
71+
72+
```json
73+
{
74+
"news": {
75+
"title": "News",
76+
"content": []
77+
},
78+
"top10": {},
79+
"tear_sheet": {},
80+
"cumulative_performace": {},
81+
"objective": {},
82+
"key_profile": {},
83+
"ownership": {},
84+
"risk_statistics": {},
85+
"dividends": {},
86+
"overall_ratings": {},
87+
"mf_esg": {},
88+
"mf_key_ratios": {}
89+
}
90+
```

setup.py

+42-42
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,61 @@
66

77
setup(
88

9-
# this will be my Library name.
10-
name='interactive-broker-python-web-api',
9+
# this will be my Library name.
10+
name='interactive-broker-python-web-api',
1111

12-
# Want to make sure people know who made it.
13-
author='Alex Reed',
12+
# Want to make sure people know who made it.
13+
author='Alex Reed',
1414

15-
# also an email they can use to reach out.
16-
author_email='[email protected]',
15+
# also an email they can use to reach out.
16+
author_email='[email protected]',
1717

18-
# I'm in alpha development still, so a compliant version number is a1.
19-
# read this as MAJOR VERSION 0, MINOR VERSION 1, MAINTENANCE VERSION 0
20-
version='0.1.0',
21-
description='A python client library for the Interactive Broker Web API.',
18+
# I'm in alpha development still, so a compliant version number is a1.
19+
# read this as MAJOR VERSION 0, MINOR VERSION 1, MAINTENANCE VERSION 0
20+
version='0.1.2',
21+
description='A python client library for the Interactive Broker Web API.',
2222

23-
# I have a long description but that will just be my README file.
24-
long_description=long_description,
23+
# I have a long description but that will just be my README file.
24+
long_description=long_description,
2525

26-
# want to make sure that I specify the long description as MARKDOWN.
27-
long_description_content_type="text/markdown",
26+
# want to make sure that I specify the long description as MARKDOWN.
27+
long_description_content_type="text/markdown",
2828

29-
# here is the URL you can find the code.
30-
url='https://github.com/areed1192/interactive-broker-python-api',
29+
# here is the URL you can find the code.
30+
url='https://github.com/areed1192/interactive-broker-python-api',
3131

32-
# there are some dependencies to use the library, so let's list them out.
33-
install_requires = [
34-
'certifi>=2019.11.28',
35-
'requests>=2.22.0',
36-
'urllib3>=1.25.3'
37-
],
32+
# there are some dependencies to use the library, so let's list them out.
33+
install_requires=[
34+
'certifi>=2019.11.28',
35+
'requests>=2.22.0',
36+
'urllib3>=1.25.3'
37+
],
3838

39-
# here are the packages I want "build."
40-
packages=find_packages(include = ['ibw']),
39+
# here are the packages I want "build."
40+
packages=find_packages(include=['ibw']),
4141

42-
# additional classifiers that give some characteristics about the package.
43-
classifiers=[
42+
# additional classifiers that give some characteristics about the package.
43+
classifiers=[
4444

45-
# I want people to know it's still early stages.
46-
'Development Status :: 3 - Alpha',
45+
# I want people to know it's still early stages.
46+
'Development Status :: 3 - Alpha',
4747

48-
# My Intended audience is mostly those who understand finance.
49-
'Intended Audience :: Financial and Insurance Industry',
48+
# My Intended audience is mostly those who understand finance.
49+
'Intended Audience :: Financial and Insurance Industry',
5050

51-
# My License is MIT.
52-
'License :: OSI Approved :: MIT License',
51+
# My License is MIT.
52+
'License :: OSI Approved :: MIT License',
5353

54-
# I wrote the client in English
55-
'Natural Language :: English',
54+
# I wrote the client in English
55+
'Natural Language :: English',
5656

57-
# The client should work on all OS.
58-
'Operating System :: OS Independent',
57+
# The client should work on all OS.
58+
'Operating System :: OS Independent',
5959

60-
# The client is intendend for PYTHON 3
61-
'Programming Language :: Python :: 3'
62-
],
60+
# The client is intendend for PYTHON 3
61+
'Programming Language :: Python :: 3'
62+
],
6363

64-
# you will need python 3.7 to use this libary.
65-
python_requires='>3.7'
66-
)
64+
# you will need python 3.7 to use this libary.
65+
python_requires='>3.7'
66+
)

0 commit comments

Comments
 (0)