sa

stackexchange-api

A Node.js wrapper for the StackExchange API

Showing:

Popularity

Downloads/wk

0

GitHub Stars

5

Maintenance

Last Commit

2yrs ago

Contributors

0

Package

Dependencies

2

License

MIT

Type Definitions

Built-In

Tree-Shakeable

No?

Readme

stackexchange-api

npm CircleCI npm NPM GitHub issues

A Node.js wrapper for the StackExchange API

Documentation

Disclaimer: WIP. Doesn't work with many endpoints yet.

Features:

  • stackexchange-api provides a simple way to access the StackExchange API endpoints
  • All complex data types from the API have a corresponding Object
  • stackexchange-api is written in TypeScript and every field of every request option / result has (will eventually have) type definitions. As a result, modern editors are able to provide extensive autocompletion.

Installation

Using npm:

npm install --save stackexchange-api

Using yarn:

yarn add stackexchange-api

Usage

Including in a project:

  • ES6:
import {StackExchange} from 'stackexchange-api';
  • CommonJS:
const StackExchangeApi = require('stackexchange-api');

Example usage:

import {StackExchange} from 'stackexchange-api';
StackExchange.search({ // Equivalent to the /search endpoint. Go to https://paul-soporan.github.io/stackexchange-api/classes/stackexchange.html#search for details.
  inTitle: 'nodejs',
  site: 'stackoverflow'
}).then((result) => {
  console.log(result);
  // Output: Wrapper<Question>
  console.log(result.items);
  // Output: an array of Questions (Question[])
  console.log(result.items[0]);
  // Output: the first Question
  console.log(result.items[0].viewCount);
  // Output: the view count of the first Question
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Tutorials

No tutorials found
Add a tutorial