diff --git a/README.md b/README.md index 48442d1..4c8c87a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,27 @@ The intent is to simplify the request process by handling the tedious logic. It' [![npm version](https://badge.fury.io/js/ebay-node-api.svg)](https://badge.fury.io/js/ebay-node-api) [![Build Status](https://travis-ci.org/ajay2507/ebay-node-api.svg?branch=master)](https://travis-ci.org/ajay2507/ebay-node-api) -# Installing + +## Table of Contents + + + + + +* [Installation](#installation) +* [Usage](#usage) +* [Examples](#examples) + * [Getting Access Token](#getaccesstoken) + * [Fetch Items By Keyword](#fetchitemsbykeyword) + * [Get All Categories](#getallcategories) + * [Get Items By Category](#getitemsbycategory) +* [Test](#test) +* [Issues](#issues) +* [LICENSE](#license) + + + +## Installation ```shell npm install ebay-node-api @@ -25,7 +45,7 @@ let ebay = new eBay({ ``` Creates a new `Ebay` instance. -### How to get clientId: +### Getting Client ID: Join eBay developers program. Register your app here https://go.developer.ebay.com/quick-start-guide. @@ -36,7 +56,7 @@ Register your app here https://go.developer.ebay.com/quick-start-guide. - `limit` - optional(`Number`) - fetch items functionality - Number that limits the number of data you need in response. - `details` - optional(`Boolean`) - Get User Details functionality - true, if you need details about the user. -#### Example +## Example ## GetAccessToken @@ -72,7 +92,37 @@ ebay.findItemsByKeywords("iphone").then((data) => { }); ``` -## How do I run the tests? +## GetAllCategories +```javascript +const Ebay = require('../src/index'); + +let ebay = new Ebay({ + clientID: "-- Client App id ----", + details: "childCategories" //optional parameter +}); + +ebay.getAllCategories().then((data) => { + console.log(data); //extract data.CategoryArray +}, (error) => { + console.log(error); +}) +``` +## GetItemsByCategory +```javascript +const Ebay = require('../src/index'); + +let ebay = new Ebay({ + clientID: "-- Client APP ID ----", + limit: 6 +}); +ebay.findItemsByCategory(10181).then((data) => { + console.log(data); +}, (error) => { + console.log(error); +}); +``` + +## Test All test files are present inside test folder. You can run using ```javascript @@ -81,6 +131,8 @@ npm run test ## Issues: If you are facing any issues, you can create the issues [here](https://github.com/ajay2507/ebay-node-api/issues). +## License: +MIT. ## Examples: I have mentioned the examples here