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

allegro

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

allegro

Allegro.pl WebAPI client

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

allegro.js

Build Status

Installation

npm install allegro

Usage

var allegro = require('allegro');

allegro.createClient({ key: 'your_webapi_key'}, function (err, client) {
    client.getUser(26729811, function (err, user) {
        console.log(user.login);
    });
});

Documentation

allegro

createClient(options, callback)

Creates API client. Available options:

  • key - WebAPI key, can be generated in My Allegro (required),
  • countryId - country code, default: 1 (Poland)
  • login - user login, credentials are needed to call some of methods (I don't know why but even for those not related to My Allegro) so, in most cases you should provide them,
  • password - user password.

callback gets two arguments:

  • error - Error instance if error occured,
  • client - Client instance
Example
var allegro = require('allegro');
var key = 'your_webapi_key';

allegro.createClient({ key: 'your_webapi_key'}, function (error, client) {
    ...
});

Client

getCategory(categoryId, callback)

Get Category instance by id and pass to callback.

Example
allegro.createClient({ … }, function (error, client) {
    client.getCategory(149, function (error, category) {
        console.log(category.name); // 'Samochody' 
    });
});

getItem(itemId, callback)

Get Item instance by id and pass to callback.

Example
allegro.createClient({ … }, function (error, client) {
    client.getItem(3482560106, function (error, item) {
        console.log(item.name); // 'IGŁA BMW E90' 
    });
});

getUser(userId, callback)

Get User instance by id and pass to callback.

Example
allegro.createClient({ … }, function (error, client) {
    client.getUser(26729811, function (error, user) {
        console.log(user.login); // 'stendi_pl' 
    });
});

Category

Proporties:

  • id int,
  • name string.

Item

Proporties:

  • id int,
  • name string.

Methods:

  • getSeller(callback) get User instance of seller. callback gets error and User instance. Example:
allegro.createClient({ … }, function (error, client) {
    client.getItem(3509260334, function (error, item) {
        item.getSeller(function(error, user) {
            console.log(user.login); // 'stendi_pl' 
        })
    });
});

User

Proporties:

  • id int,
  • login string,
  • rating int,
  • createdAt Date,
  • isAllegroStandrd bool.

Keywords

FAQs

Package last updated on 03 Sep 2013

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