Code Monkey home page Code Monkey logo

iex-cpp-client's Introduction

IEX Finance C++ Client

Build Status

C++ client to consume the IEX Finance API.

Usage

IEX C++ Client 

./main stock_symbol option
    ex: ./main AMZN -p 

 options:
   -c Company Information
   -l Company Logo
   -p Stock Latest Price
   -s Stock Statistics
   -r Stock Financial Reports
   -d Stock Dividends

Compilation

On Debian-based distributions you can install the required dependencies using the following command:

sudo apt-get install libjsoncpp-dev libcurl4-gnutls-dev

On MacOS using Homebrew:

brew install jsoncpp; brew install curl

g++ -o main main.cpp -lcurl -ljsoncpp -std=c++11

./main AMZN -p

Called Endpoint: https://api.iextrading.com/1.0/stock/AMZN/price
Stock Symbol: AMZN
Latest Price: $1952.07

Compiling Using CMake

Compile this project using standing CMake:

mkdir build
cd build
cmake ..
make
./main AMZN

Or, for an optimized build:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release
make
./main AMZN

Contributing

See CONTRIBUTING.

Copyright and License

Copyright (c) 2018, Rodolfo Bandeira and Contributors.

This project is licensed under the MIT License.

Data provided for free by IEX, see terms.

iex-cpp-client's People

Contributors

mpherg avatar mvilkin avatar rodolfobandeira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

iex-cpp-client's Issues

Add error handler when stock symbol is invalid

./main STOCK_SYMBOL_THAT_DOESNT_EXIST -d
Error from reader: * Line 1, Column 1
  Syntax error: value, object or array expected.
terminate called after throwing an instance of 'Json::RuntimeError'
  what():  * Line 1, Column 1
  Syntax error: value, object or array expected.

Aborted (core dumped)

IEX Cloud

#rip to the free, open and public IEX API. Looks like now everyone that wants to use it will need to create an account on https://iexcloud.io/ and get its own token.

That being said, we might need to implement support to this new logic on the project.

I didn't scope the effort to implement it here yet. I'll take a look on how it was implemented on https://github.com/dblock/iex-ruby-client and update here before starting this task

To use or not to use clang-format

@rodolfobandeira how to you feel about adding a clause to the README.md requiring clang-formatting for all contributions? It's a nice way to keep the formatting of the code consistently readable and maintainable. However, it also requires another tool. I like it because it can be easily integrated into nearly every editor, as well as git (git clang-format, anyone?).

Fix deprecation warnings on MacOS and libjsoncpp > 1.7

Homebrew installs the latest jsoncpp library. (Version: 1.8.4). On this version there is a deprecation warning message saying that we should replace Json::Reader to Json::CharReaderBuilder

There is no deprecation warnings when using jsoncpp 1.7.*.

Work in progress: #8

Static in namespace{} in IEX.h

Why are the functions in the empty name namespace static? g++ *.cpp -std=c++11 -ljsoncpp -lcurl -o exa.out && ./exa.out AMZN -a compiles fine without the static keyword.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.