Giter Site home page Giter Site logo

huytd / yahoo-finance-graphql Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 68 KB

GraphQL server for Yahoo Finance

Home Page: https://yahoo-finance-graphql.herokuapp.com/

TypeScript 100.00%
yahoo-finance yahoo-finance-api graphql-server graphql graphql-api apollo-server apollo

yahoo-finance-graphql's Introduction

Yahoo Finance GraphQL API

A GraphQL API for fetching data from Yahoo Finance, thanks to node-yahoo-finance2.

Online Demo: https://yahoo-finance-graphql.herokuapp.com/

Available APIs:

How to use

Run the GraphQL server with the following command:

$ yarn install

$ yarn start

Examples

Get historical data since 01/01/2021:

QueryResponse
query {
  historicalData(
    symbol: "IBM"
    from: "2021-01-01"
    to: ""
    interval: "1d"
  ) {
    open
    close
    high
    low
  }
}
{

  "data": {
    "historicalData": [
      {
        "open": 125.849998,
        "close": 123.940002,
        "high": 125.919998,
        "low": 123.040001
      },
      {
        "open": 125.010002,
        "close": 126.139999,
        "high": 126.68,
        "low": 124.610001
      },
      ...
    ]
  }
}

Get top 10 trending symbols with quote:

QueryResponse
query {
  trendingSymbols(count: 3) {
    symbol,
    quote {
      displayName,
      regularMarketPrice,
      regularMarketChange,
      regularMarketChangePercent
    }
  }
}
{
  "data": {
    "trendingSymbols": [
      {
        "symbol": "ORPH",
        "quote": {
          "displayName": null,
          "regularMarketPrice": 16.21,
          "regularMarketChange": 6.159999,
          "regularMarketChangePercent": 61.293518
        }
      },
      {
        "symbol": "CVAC",
        "quote": {
          "displayName": "CureVac",
          "regularMarketPrice": 94.79,
          "regularMarketChange": -3.409996,
          "regularMarketChangePercent": -3.472501
        }
      },
      {
        "symbol": "VINO",
        "quote": {
          "displayName": "Gaucho",
          "regularMarketPrice": 7.98,
          "regularMarketChange": 3.8899999,
          "regularMarketChangePercent": 95.110016
        }
      }
    ]
  }
}

Auto complete stock's symbol:

QueryResponse
query {
  autoComplete(query: "IB") {
    symbol
    name
  }
}
{
  "data": {
    "autoComplete": [
      {
        "symbol": "IBBQ",
        "name": "Invesco Nasdaq Biotechnology ETF"
      },
      {
        "symbol": "IBM",
        "name": "International Business Machines Corporation"
      },
      {
        "symbol": "IBIO",
        "name": "iBio, Inc."
      },
      ...
    ]
  }
}

yahoo-finance-graphql's People

Contributors

huytd avatar

Stargazers

Global Young avatar Tejas G. avatar Liam Germain avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

younghakim7

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.