Skip to content

Commit

Permalink
typed params for most requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwho committed Jan 21, 2020
1 parent b657b7c commit 6396a93
Show file tree
Hide file tree
Showing 10 changed files with 3,681 additions and 6,491 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![releases](https://img.shields.io/github/release/jonwho/go-iex.svg)](https://github.com/jonwho/go-iex/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/jonwho/go-iex)](https://goreportcard.com/report/github.com/jonwho/go-iex)
![](https://github.com/jonwho/go-iex/workflows/tests/badge.svg)
<a href='https://github.com/jpoles1/gopherbadger' target='_blank'>![gopherbadger-tag-do-not-edit](https://img.shields.io/badge/Go%20Coverage-94%25-brightgreen.svg?longCache=true&style=flat)</a>
<a href='https://github.com/jpoles1/gopherbadger' target='_blank'>![gopherbadger-tag-do-not-edit](https://img.shields.io/badge/Go%20Coverage-93%25-brightgreen.svg?longCache=true&style=flat)</a>

## ATTRIBUTION
[Data provided by IEX](https://iexcloud.io)
Expand Down
65 changes: 53 additions & 12 deletions cassettes/stock/earnings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ interactions:
url: https://sandbox.iexapis.com/stable/stock/aapl/earnings
method: GET
response:
body: '{"symbol":"AAPL","earnings":[{"actualEPS":2.25,"consensusEPS":2.09,"announceTime":"CAM","numberOfEstimates":37,"EPSSurpriseDollar":0.09,"EPSReportDate":"2019-08-01","fiscalPeriod":"Q2
2019","fiscalEndDate":"2019-06-30","yearAgo":2.35,"yearAgoChangePercent":-0.0701}]}'
body: '{"symbol":"AAPL","earnings":[{"actualEPS":3.09,"consensusEPS":2.84,"announceTime":"CMA","numberOfEstimates":41,"EPSSurpriseDollar":0.2,"EPSReportDate":"2019-11-10","fiscalPeriod":"Q3
2019","fiscalEndDate":"2019-10-04","yearAgo":2.94,"yearAgoChangePercent":0.0414}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -24,16 +24,16 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Fri, 25 Oct 2019 00:07:51 GMT
- Tue, 21 Jan 2020 06:20:35 GMT
Iexcloud-Messages-Used:
- "1000"
Iexcloud-Premium-Messages-Used:
- "0"
Server:
- nginx
Set-Cookie:
- ctoken=da32759dba74447dbf287ccfc4dc1da2; Max-Age=43200; Path=/; Expires=Fri,
25 Oct 2019 12:07:51 GMT
- ctoken=ccd91452e94940dba75f3291bbf70ddc; Max-Age=43200; Path=/; Expires=Tue,
21 Jan 2020 18:20:35 GMT
Strict-Transport-Security:
- max-age=15768000
X-Content-Type-Options:
Expand All @@ -47,12 +47,12 @@ interactions:
headers:
User-Agent:
- jonwho/goiex
url: https://sandbox.iexapis.com/stable/stock/aapl/earnings?last=2
url: https://sandbox.iexapis.com/stable/stock/aapl/earnings?last=2&period=annual
method: GET
response:
body: '{"symbol":"AAPL","earnings":[{"actualEPS":2.26,"consensusEPS":2.16,"announceTime":"CAM","numberOfEstimates":38,"EPSSurpriseDollar":0.09,"EPSReportDate":"2019-08-01","fiscalPeriod":"Q2
2019","fiscalEndDate":"2019-07-09","yearAgo":2.38,"yearAgoChangePercent":-0.0706},{"actualEPS":2.57,"consensusEPS":2.46,"announceTime":"AMC","numberOfEstimates":34,"EPSSurpriseDollar":0.1,"EPSReportDate":"2019-05-15","fiscalPeriod":"Q1
2019","fiscalEndDate":"2019-04-08","yearAgo":2.75,"yearAgoChangePercent":-0.101}]}'
body: '{"symbol":"AAPL","earnings":[{"actualEPS":11.98,"consensusEPS":11.76,"announceTime":"AMC","numberOfEstimates":42,"EPSSurpriseDollar":0.21,"EPSReportDate":"2019-11-13","fiscalPeriod":"FY
ending in 2019","fiscalEndDate":"2019-10-11","yearAgo":12.2,"yearAgoChangePercent":-0.0018},{"actualEPS":12.33,"announceTime":"CMA","EPSReportDate":"2018-11-03","fiscalPeriod":"FY
ending in 2018","fiscalEndDate":"2018-10-05","yearAgo":9.27,"yearAgoChangePercent":0.3054}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -65,16 +65,57 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Fri, 25 Oct 2019 00:07:51 GMT
- Tue, 21 Jan 2020 06:20:35 GMT
Iexcloud-Messages-Used:
- "2000"
Iexcloud-Premium-Messages-Used:
- "0"
Server:
- nginx
Set-Cookie:
- ctoken=a302ffaf5e114703a4c067a340a30a62; Max-Age=43200; Path=/; Expires=Fri,
25 Oct 2019 12:07:51 GMT
- ctoken=5991177890de4b2dabe59afcc15ae65f; Max-Age=43200; Path=/; Expires=Tue,
21 Jan 2020 18:20:35 GMT
Strict-Transport-Security:
- max-age=15768000
X-Content-Type-Options:
- nosniff
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
User-Agent:
- jonwho/goiex
url: https://sandbox.iexapis.com/stable/stock/aapl/earnings?last=2&period=quarter
method: GET
response:
body: '{"symbol":"AAPL","earnings":[{"actualEPS":3.09,"consensusEPS":2.92,"announceTime":"AMC","numberOfEstimates":40,"EPSSurpriseDollar":0.2,"EPSReportDate":"2019-11-09","fiscalPeriod":"Q3
2019","fiscalEndDate":"2019-10-06","yearAgo":2.96,"yearAgoChangePercent":0.0414},{"actualEPS":2.19,"consensusEPS":2.19,"announceTime":"MCA","numberOfEstimates":39,"EPSSurpriseDollar":0.09,"EPSReportDate":"2019-08-03","fiscalPeriod":"Q2
2019","fiscalEndDate":"2019-06-30","yearAgo":2.39,"yearAgoChangePercent":-0.0715}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods:
- GET, OPTIONS
Access-Control-Allow-Origin:
- '*'
Content-Type:
- application/json; charset=utf-8
Date:
- Tue, 21 Jan 2020 06:20:35 GMT
Iexcloud-Messages-Used:
- "2000"
Iexcloud-Premium-Messages-Used:
- "0"
Server:
- nginx
Set-Cookie:
- ctoken=df2dd50cb3c841aab93e852cd9128d36; Max-Age=43200; Path=/; Expires=Tue,
21 Jan 2020 18:20:35 GMT
Strict-Transport-Security:
- max-age=15768000
X-Content-Type-Options:
Expand Down
71 changes: 16 additions & 55 deletions cassettes/stock/financials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interactions:
url: https://sandbox.iexapis.com/stable/stock/aapl/financials
method: GET
response:
body: '{"symbol":"AAPL","financials":[{"reportDate":"2019-07-09","grossProfit":21065697841,"costOfRevenue":34927841793,"operatingRevenue":55822550933,"totalRevenue":54352163538,"operatingIncome":11846337636,"netIncome":10217982149,"researchAndDevelopment":4304549180,"operatingExpense":44364517238,"currentAssets":136708264086,"totalAssets":331063596878,"totalLiabilities":235673122681,"currentCash":23974557197,"currentDebt":24460995497,"shortTermDebt":24386480491,"longTermDebt":87109426613,"totalCash":97085165742,"totalDebt":112673871147,"shareholderEquity":98600148333,"cashChange":12765048751,"cashFlow":12183329483}]}'
body: '{"symbol":"AAPL","financials":[{"reportDate":"2019-10-13","grossProfit":24204844489,"costOfRevenue":40782159343,"operatingRevenue":64746691790,"totalRevenue":67040143450,"operatingIncome":15607513939,"netIncome":14190189154,"researchAndDevelopment":4129736428,"operatingExpense":49844136831,"currentAssets":164830313552,"totalAssets":342150962610,"totalLiabilities":255789421143,"currentCash":29112482291,"currentDebt":16487549341,"shortTermDebt":16442138656,"longTermDebt":95465098035,"totalCash":104177888769,"totalDebt":112796983781,"shareholderEquity":92049578201,"cashChange":-2000272694,"cashFlow":20254264818}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -23,16 +23,16 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Fri, 25 Oct 2019 01:01:24 GMT
- Tue, 21 Jan 2020 06:24:37 GMT
Iexcloud-Messages-Used:
- "5000"
Iexcloud-Premium-Messages-Used:
- "0"
Server:
- nginx
Set-Cookie:
- ctoken=a9da0dd1177646bab326c9198fba2357; Max-Age=43200; Path=/; Expires=Fri,
25 Oct 2019 13:01:24 GMT
- ctoken=c2e25e20592843c6970cb07516e354b8; Max-Age=43200; Path=/; Expires=Tue,
21 Jan 2020 18:24:37 GMT
Strict-Transport-Security:
- max-age=15768000
X-Content-Type-Options:
Expand All @@ -46,10 +46,10 @@ interactions:
headers:
User-Agent:
- jonwho/goiex
url: https://sandbox.iexapis.com/stable/stock/aapl/financials/2
url: https://sandbox.iexapis.com/stable/stock/aapl/financials?period=annual
method: GET
response:
body: '{"symbol":"AAPL","financials":[{"reportDate":"2019-07-06","grossProfit":20442907719,"costOfRevenue":34080918164,"operatingRevenue":56254013223,"totalRevenue":53925669222,"operatingIncome":11821701505,"netIncome":10285594631,"researchAndDevelopment":4363631147,"operatingExpense":43283076442,"currentAssets":138863575882,"totalAssets":336447680846,"totalLiabilities":230019846718,"currentCash":23273128414,"currentDebt":24323616581,"shortTermDebt":24294023221,"longTermDebt":85915785085,"totalCash":96559018263,"totalDebt":113722955801,"shareholderEquity":101197873107,"cashChange":12783023003,"cashFlow":11741535810},{"reportDate":"2019-04-14","grossProfit":22278563440,"costOfRevenue":37538940113,"operatingRevenue":58707931263,"totalRevenue":58406985478,"operatingIncome":13887009467,"netIncome":11566956337,"researchAndDevelopment":3951606878,"operatingExpense":46502122222,"currentAssets":124469006970,"totalAssets":353762746513,"totalLiabilities":238275705685,"currentCash":21519878034,"currentDebt":22498567446,"shortTermDebt":23371310214,"longTermDebt":91312493433,"totalCash":80915358674,"totalDebt":115954060952,"shareholderEquity":110666188350,"cashChange":-5143336993,"cashFlow":11212413185}]}'
body: '{"symbol":"AAPL","financials":[{"reportDate":"2019-10-02","grossProfit":101813784068,"costOfRevenue":168108130093,"operatingRevenue":269552010738,"totalRevenue":266757450986,"operatingIncome":65768339740,"netIncome":56468798498,"researchAndDevelopment":16369896912,"operatingExpense":206358924789,"currentAssets":163632132182,"totalAssets":352409963419,"totalLiabilities":253403822137,"currentCash":28183418279,"currentDebt":16786211621,"shortTermDebt":16727201843,"longTermDebt":95221354543,"totalCash":102906827921,"totalDebt":109415517730,"shareholderEquity":91552365931,"cashChange":24587073774,"cashFlow":70849025921}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -62,55 +62,16 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Fri, 25 Oct 2019 01:01:25 GMT
- Tue, 21 Jan 2020 06:24:37 GMT
Iexcloud-Messages-Used:
- "10000"
Iexcloud-Premium-Messages-Used:
- "0"
Server:
- nginx
Set-Cookie:
- ctoken=a9b9530460c2440c9a46cd2307470473; Max-Age=43200; Path=/; Expires=Fri,
25 Oct 2019 13:01:25 GMT
Strict-Transport-Security:
- max-age=15768000
X-Content-Type-Options:
- nosniff
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
User-Agent:
- jonwho/goiex
url: https://sandbox.iexapis.com/stable/stock/aapl/financials/2/annual
method: GET
response:
body: '{"symbol":"AAPL","financials":[{"reportDate":"2019-07-13","grossProfit":20528482806,"costOfRevenue":34489628346,"operatingRevenue":55251448883,"totalRevenue":56158911974,"operatingIncome":11915587749,"netIncome":10414607189,"researchAndDevelopment":4371981277,"operatingExpense":43777105574,"currentAssets":136133587943,"totalAssets":325671423997,"totalLiabilities":230875314176,"currentCash":22967212833,"currentDebt":23573026817,"shortTermDebt":24085247502,"longTermDebt":87592126100,"totalCash":98199996685,"totalDebt":108726808375,"shareholderEquity":99459449272,"cashChange":12434898949,"cashFlow":11963993167},{"reportDate":"2019-04-02","grossProfit":22657121708,"costOfRevenue":37752807549,"operatingRevenue":58681645016,"totalRevenue":58594819309,"operatingIncome":13711072198,"netIncome":12042743575,"researchAndDevelopment":4132060133,"operatingExpense":45283239312,"currentAssets":127494593819,"totalAssets":356692805446,"totalLiabilities":236567891261,"currentCash":21723596959,"currentDebt":23136741975,"shortTermDebt":22600318795,"longTermDebt":93498214174,"totalCash":81370129866,"totalDebt":115501043827,"shareholderEquity":109876583793,"cashChange":-5028385003,"cashFlow":11697884457}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods:
- GET, OPTIONS
Access-Control-Allow-Origin:
- '*'
Content-Type:
- application/json; charset=utf-8
Date:
- Fri, 25 Oct 2019 01:01:25 GMT
Iexcloud-Messages-Used:
- "10000"
- "5000"
Iexcloud-Premium-Messages-Used:
- "0"
Server:
- nginx
Set-Cookie:
- ctoken=2058456a3f8947668a5b9be139390c5e; Max-Age=43200; Path=/; Expires=Fri,
25 Oct 2019 13:01:25 GMT
- ctoken=cc539bb9312646eb9014e5443e99c8d2; Max-Age=43200; Path=/; Expires=Tue,
21 Jan 2020 18:24:37 GMT
Strict-Transport-Security:
- max-age=15768000
X-Content-Type-Options:
Expand All @@ -124,10 +85,10 @@ interactions:
headers:
User-Agent:
- jonwho/goiex
url: https://sandbox.iexapis.com/stable/stock/aapl/financials/2/annual?period=quarterly
url: https://sandbox.iexapis.com/stable/stock/aapl/financials?period=quarter
method: GET
response:
body: '{"symbol":"AAPL","financials":[{"reportDate":"2019-07-11","grossProfit":20863762878,"costOfRevenue":33890335501,"operatingRevenue":54340420984,"totalRevenue":55319273607,"operatingIncome":11910159295,"netIncome":10054736762,"researchAndDevelopment":4439601925,"operatingExpense":43974965939,"currentAssets":136147857510,"totalAssets":327102387310,"totalLiabilities":229017746182,"currentCash":23864460118,"currentDebt":24020381128,"shortTermDebt":24070079725,"longTermDebt":85789108964,"totalCash":98974569070,"totalDebt":108826090451,"shareholderEquity":100656050572,"cashChange":12497911767,"cashFlow":11720899520},{"reportDate":"2019-04-02","grossProfit":22335015165,"costOfRevenue":36844136302,"operatingRevenue":59639423526,"totalRevenue":58900087752,"operatingIncome":13784723492,"netIncome":11983618450,"researchAndDevelopment":3967700808,"operatingExpense":44893417636,"currentAssets":126452426140,"totalAssets":353638518050,"totalLiabilities":236642556072,"currentCash":20895585103,"currentDebt":22646109521,"shortTermDebt":22891534545,"longTermDebt":94317456933,"totalCash":84016760302,"totalDebt":113488400232,"shareholderEquity":106626210241,"cashChange":-5063763077,"cashFlow":11455108367}]}'
body: '{"symbol":"AAPL","financials":[{"reportDate":"2019-10-01","grossProfit":24249546258,"costOfRevenue":40731156222,"operatingRevenue":66673166993,"totalRevenue":65499876498,"operatingIncome":15686113038,"netIncome":14146311146,"researchAndDevelopment":4279135345,"operatingExpense":50317751073,"currentAssets":165226794223,"totalAssets":352569623094,"totalLiabilities":253820478337,"currentCash":28652976051,"currentDebt":17051287775,"shortTermDebt":16983896424,"longTermDebt":92085964551,"totalCash":103130749954,"totalDebt":111785001832,"shareholderEquity":92085360216,"cashChange":-1998875200,"cashFlow":19971538618}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
Expand All @@ -140,16 +101,16 @@ interactions:
Content-Type:
- application/json; charset=utf-8
Date:
- Fri, 25 Oct 2019 01:01:25 GMT
- Tue, 21 Jan 2020 06:24:37 GMT
Iexcloud-Messages-Used:
- "10000"
- "5000"
Iexcloud-Premium-Messages-Used:
- "0"
Server:
- nginx
Set-Cookie:
- ctoken=4c7a50c85167462bb14ebadea57a1fb8; Max-Age=43200; Path=/; Expires=Fri,
25 Oct 2019 13:01:25 GMT
- ctoken=5f6de50a4d7447f4bdaf21b1b01fea0e; Max-Age=43200; Path=/; Expires=Tue,
21 Jan 2020 18:24:37 GMT
Strict-Transport-Security:
- max-age=15768000
X-Content-Type-Options:
Expand Down
Loading

0 comments on commit 6396a93

Please sign in to comment.