Skip to content

bobbyhalljr/Crypto-Graphql-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend URL (Endpoint): https://crypto-graphql-api.herokuapp.com/

❗️ crypto-graphql-api is created with apollo-server, and built on top of the coinpaprika REST API, there docs can be found here

Getting started

clone or download the project from github

To install dependencies run

npm i or npm install

To start the server run

npm run server

Once your server is started you can go to http://localhost:4040 to get access to the graphql playground.

Examples

Get all coins

query coins {
  coins {
    id
    name
    symbol
    rank
    quotes {
      USD {
        price
        market_cap
        percent_change_1h
      }
    }
  }
}

response

{
  "data": {
    "coins": [
      {
        "id": "btc-bitcoin",
        "name": "Bitcoin",
        "symbol": "BTC",
        "rank": 1,
        "quotes": {
          "USD": {
            "price": 9648.87111781,
            "market_cap": 177443038971,
            "percent_change_1h": -0.15
          }
        }
      },
      {
        "id": "miota-iota",
        "name": "IOTA",
        "symbol": "MIOTA",
        "rank": 24,
        "quotes": {
          "USD": {
            "price": 0.21740303,
            "market_cap": 604278305,
            "percent_change_1h": -0.81
          }
        }
      },
      {"the list goes on": "over 1400 coins ..."}

get a single coin (id - required)

query coin {
  coin(id: "btc-bitcoin"){
    id
    name
    symbol
    rank
    is_new
    is_active
    description
    team {
      name
      position
    }
  }
}

response

{
  "data": {
    "coin": {
      "id": "btc-bitcoin",
      "name": "Bitcoin",
      "symbol": "BTC",
      "rank": 1,
      "is_new": false,
      "is_active": true,
      "description": "Bitcoin is a cryptocurrency and worldwide payment system. It is the first decentralized digital currency, as the system works without a central bank or single administrator.",
      "team": [
        {
          "name": "Satoshi Nakamoto",
          "position": "Founder"
        },
        {
          "name": "Wladimir J. van der Laan",
          "position": "Blockchain Developer"
        },
        {
          "name": "Jonas Schnelli",
          "position": "Blockchain Developer"
        },
        {
          "name": "Marco Falke",
          "position": "Blockchain Developer"
        }
      ]
    }
  }
}

Schema Types

Table of Contents

Query

Field Argument Type Description
coins [Coin]
coin id CoinById!

Objects

Coin

Field Argument Type Description
id String
name String
symbol String
rank Int
quotes Quotes

CoinById

Field Argument Type Description
id String
name String
symbol String
rank Int
is_new Boolean
is_active Boolean
type String
tags [Tag]
team [Team]
description String
message String
open_source Boolean
hardware_wallet Boolean
started_at String
development_status String
proof_type String
org_structure String
hash_algorithm String
platform String
whitePaper Object
links Link
links_extended Object

Link

Field Argument Type Description
explorer [String]
facebook [String]
reddit [String]
source_code [String]
website [String]
youtube [String]

Quotes

Field Argument Type Description
USD USD

Tag

Field Argument Type Description
id String
name String
coin_counter Int
ico_counter Int

Team

Field Argument Type Description
name String
position String

USD

Field Argument Type Description
price Float
market_cap Float
percent_change_1h Float

Enums

CacheControlScope

Value Description
PUBLIC
PRIVATE

Scalars

Boolean

The Boolean scalar type represents true or false.

Float

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

ID

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Int

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Object

String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Upload

The Upload scalar type represents a file upload.

About

A graphql API for cryptocurrencies and crypto market data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors