Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/isaporiti/stock-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/isaporiti/stock-api

  • v0.0.0-20230722095427-ed32618ba47c
  • Source
  • Go
  • Socket score

Version published
Created
Source

Stock Prices API

Basic Web API that serves stub stock prices for some supported tickers and users' stock portfolios.

How to run

With Docker

Having Docker installed, you can run

# using Makefile
make docker_build
make docker_run

# or otherwise
docker build -t stock-api .
docker run --rm -p 5001:5001 stock-api

With Go

go run cmd/main.go

How to try

There are two authorized usernames: testA and testB. You can try the endpoints with the following:

User Stocks

# user testA
curl --request GET \
  --url http://localhost:5001/tickers \
  --header 'Authorization: Basic dGVzdEE6'

# user testB
curl --request GET \
  --url http://localhost:5001/tickers \
  --header 'Authorization: Basic dGVzdEI6'

Stocks history

curl --request GET \
  --url http://localhost:5001/tickers/FB/history \
  --header 'Authorization: Basic dGVzdEI6'

Unauthorized

curl --request GET \
  --url http://localhost:5001/tickers \
  --header 'Authorization: Basic dW5rbm93bjo='

Supported Tickers

You can query the history price for these tickers. Querying for anything else will result in a 404 Not found response.

  • AAPL
  • MSFT
  • GOOG
  • AMZN
  • FB
  • TSLA
  • NVDA
  • JPM
  • BABA
  • JNJ
  • WMT
  • PG
  • PYPL
  • DIS
  • ADBE
  • PFE
  • V
  • MA
  • CRM
  • NFLX

FAQs

Package last updated on 22 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc