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

dadata

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dadata

REST API for dadata.ru

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-dadata

Tiny NPM module for the REST API of dadata.ru

usage example

var dadata = require('dadata')(process.env.DADATA_API_KEY, process.env.DADATA_SECRET_KEY);
dadata('address', ['мск сухонска 11/-89'], function (err, res) {
  console.log(err);
  console.log(res);
});

formal docs

Before use, this service must be properly configured: you have to provide your API_KEY and SECRET_KEY to the constructor.

  var DaData = require('dadata'),
      dadata_account_1 = new DaData('<API_KEY_1>', '<SECRET_KEY_1>'),
      dadata_account_2 = new DaData('<API_KEY_2>', '<SECRET_KEY_2>');

If you don't plan to utilize multiple instances of dadata service, it's also possible to use the short notation.

  var dadata = require('dadata')('<YOUR_API_KEY>', '<YOUR_SECRET_KEY>');

Exposed dadata service is the function of 3 arguments (function (apiType, queries, callback) {...}), where:

  • api type -- one of ['address', 'birthdate', 'email', 'name', 'phone'];
  • queries array -- array of one or more strings;
  • callback -- function (error, result) {...}; if everything's fine, then error is undefined and result contains a dadata response (an array of objects, corresponding to your array of queries); if something went wrong, error will contain an object with code and message fields, and result will be undefined.

Keywords

FAQs

Package last updated on 27 Nov 2014

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