2.0.2 • Published 6 months ago

bricklink-api v2.0.2

Weekly downloads
18
License
SEE LICENCE IN LI...
Repository
github
Last release
6 months ago

bricklink-api

Node.js CI

Node package for connecting to Bricklink's API.

npm install --save bricklink-api

Basic Usage

Initialize a client with your OAuth credentials as supplied at the following:

https://www.bricklink.com/v2/api/register_consumer.page

You are required to have a Bricklink account and register your IP address from which your application will be using the API. You can also use 0.0.0.0 to match any IP address (such as a cloud solution); however, you would need to keep the keys and secrets secure.

var api = require('bricklink-api');
var Client = api.Client,
    ItemType = api.ItemType;

var bricklink = new Client({
    "consumer_key": "<ConsumerKey>",
    "consumer_secret": "<ConsumerSecret>",
    "token": "<TokenValue>",
    "token_secret": "<TokenSecret>"
  });

bricklink.getCatalogItem(ItemType.Part, '3001')
  .then(function(part){
    console.log(part);
  });

\\ Alternate Usage:

var CatalogItem = api.CatalogItem;
var req = CatalogItem.get(ItemType.Part, '3001');
bricklink.send(req)
  .then(function(part){
    console.log(part);
  });

ES6 Support

Read basic usage.

import {Client, ItemType, CatalogItem} from 'bricklink-api';

const bricklink = new Client({
    "consumer_key": "<ConsumerKey>",
    "consumer_secret": "<ConsumerSecret>",
    "token": "<TokenValue>",
    "token_secret": "<TokenSecret>"
  });

bricklink.getCatalogItem(ItemType.Part, '3001')
  .then(part => console.log(part));

\\ Alternate Usage:

let req = CatalogItem.get(ItemType.Part, '3001');
bricklink.send(req)
  .then(part => console.log(part));

Documentation

Full API documentation is available at:

https://ryansh100.github.io/bricklink-api

Change Log

  • 2017/04/03: Fix bugs with require of dictionaries. Update to make more intuitive imports. Add support for color and category lookup.
  • 2021/05/01: Updating the compiling engine, updating the way tests are run
2.0.2

6 months ago

1.2.11

10 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.2.10

2 years ago

1.2.8

2 years ago

1.2.9

2 years ago

1.2.7

2 years ago

1.2.5

2 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.0

3 years ago

1.1.3

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago