forked from MCBurda/wallstreetbets-sentiment-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Secrets.py
38 lines (31 loc) · 1.7 KB
/
Secrets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import praw
import pyEX
# ------- Authentication Information fro APIs ---------
# I am using the PRAW wrapper for the Reddit developer API, which provides me with simplified methods to access the different
# functionalities of the Reddit API. The wrapper also times the API calls for me, in order for me not to break the allowed call limits.
# Documentation: https://praw.readthedocs.io/
# Register your app with Reddit: https://www.reddit.com/prefs/apps
reddit = praw.Reddit(
client_id="INSERT OWN CLIENT ID FROM REDDIT",
client_secret="INSERT OWN CLEINT SECRET",
user_agent="INSERT OWN USER AGENT"
)
# TextAnalysis API Information for sentiment analysis and entity recognition: https://rapidapi.com/textanalysis/api/textanalysis
sentiment_url = "https://textanalysis.p.rapidapi.com/pattern-sentiment-analysis"
org_url = "https://textanalysis.p.rapidapi.com/spacy-named-entity-recognition-ner"
headers = {
'x-rapidapi-host': "textanalysis.p.rapidapi.com",
'x-rapidapi-key': "ENTER OWN SECRET",
'content-type': "application/x-www-form-urlencoded"
}
# Financial Modelling Prep API for ticker recognition
company_search_api = "https://financialmodelingprep.com/api/v3/search?query="
company_search_sk = "ENTER OWN SECRET"
# IEX API
# IEX is an American stock exchange that offers a free API to retrieve company data based on the ticker symbol
# I installed a free library for IEX's API called PyEx, since it handles caching for us, allowing us to save API requests and latency
iex_pk = "ENTER OWN PUBLIC KEY "
iex_sk = "ENTER OWN SECRET KEY"
iex_api = "https://cloud.iexapis.com/"
IEX_client = pyEX.Client(api_token=iex_sk, version='v1', api_limit=5)
# ---------- END OF AUTH INFO ----------------------