Easily get, search and select for contracts, customers and suppliers on ClearSpending using their API.
Using npm:
$ npm install --save clearspending
const clearspending = require('clearspending')
const Clearspending = new clearspending()
Receive full information about the grant by the ID (get)
Clearspending
.getGrants({
id: '42'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search for grants
Clearspending
.searchGrants({productsearch: 'бетон'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Clearspending
.searchGrants({ogrn:'1036167000066'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Grants selection
Clearspending
.selectGrants({daterange:'01.01.2014-31.12.2014'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Getting customer information by identifier
Clearspending
.getCustomer({spzregnum: '01731000070'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by customer's contracts
Clearspending
.searchCustomers({orgtype:'3', sort:'-contractsSum'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by customers (select)
Clearspending
.selectCustomers({orgtype:'3', sort:'-contractsSum'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Getting contract's information by identifier
Clearspending
.getContracts({regnum:'0173100000414000011'})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by contracts
Clearspending
.searchContracts({
pricerange: '10000-50000',
customerregion: '05',
sort:'-price'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Select by contracts
Clearspending
.selectContracts({
industrial: 'A',
fz: '94'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Getting supplier information by identifier
Clearspending
.getSuppliers({
inn: '6450614330',
kpp: '645001001'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Full-text search by suppliers
Clearspending
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Select by suppliers
Clearspending
Clearspending
.searchSuppliers({
regioncode: '35',
orgform: 'i94',
sort: '-contractsSum'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})
Clearspending
.dbInfo({
info: 'all'
})
.then((result) => {console.log(result)}).catch((err) => {console.log(err)})