
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
A browser-based and node.js client to BloomAPI.
The following are steps to get BloomJS into your javascript-based project.
Place dist/bloom.min.js from the GitHub project or install it with bower (bower install bloomjs) into your project in a location accessible from the web. Include it in your site with a script tag
<script src="js/bloom.min.js"></script>
npm install bloom-js
Use it in your node project via
var bloomjs = require('bloom-js');
Create New Client
bloomjs.Client(<API Key OR options>);
API Key BloomAPI access keyoptions object can have the follow parameters
url root url of BloomAPI (e.g. http://www.bloomapi.com/api)apiKey API Key###BloomJS Client Object
bloomClient.sources(<callback>)
callback a function that will be called once results retrieved. Paramters to callback include
error an object that is set if something went wrongresponse an array of sources availablebloomClient.search(<source>, <search params>, <options>, <callback>)
source is a string that matches a BloomAPI data source name (e.g. 'usgov.hhs.npi')search params is a object that represnts a query. See Example Usage for expected object structure. Optionaloptions object with options to pass through that are not search params (e.g. 'offset' and 'limit') Optionalcallback a function that will be called once results retrieved. Parameters to callback include
error an object that is set if something went wrongresponse an array of results found given queryinfo additional information on the query/ response. Currently includes meta which is the metadata from the response (e.g. rowCount and messages)bloomClient.find(<source>, <id>, <callback>)
source is a string that matches a BloomAPI data source name (e.g. 'usgov.hhs.npi')id a string that will be used to match the ID of the dataset (e.g. the ten-digit unique NPI or an HCPCS code)callback a function that will be called once results retrieved. Parameters to callback include
error an object that is set if something went wrongresponse an single result found given idThe following will work on both the browser (using JSONP behind the scenes) and Node.js:
Create a new client
// Basic
var bloomClient = new bloomjs.Client();
// If using an API Key
var bloomClient = new bloomjs.Client('<API Key Here>');
// If using your own server (with or without your own API keys)
var bloomClient = new bloomjs.Client({
url: "http://www.bloomapi.com/api",
apiKey: "<API Key Here>" // Optional
});
Query available datasources
bloomClient.sources(function (error, response) {
if (error) return console.log(error.stack);
var source = response[0];
console.log('=== First available source');
console.log('Name: ' + source.source);
console.log('Last Checked for Updates: ' + source.checked);
});
Search the National Provider Identifier (NPI) without parameters
bloomClient.search('usgov.hhs.npi', function (error, response, info) {
if (error) return console.log(error.stack);
console.log('=== First available NPI');
console.log('NPI: ' + response[0].npi);
console.log('Total NPIs: ' + info['meta']['rowCount']);
});
Search HCPCS Procedure Codes for the code 'C9289'
bloomClient.search('usgov.hhs.hcpcs', {
'code': 'C9289'
}, function (error, response) {
if (error) return console.log(error.stack);
console.log('=== HCPCS code found');
console.log('Code: ' + response[0].code);
});
Page through search results
var bloomjs = require('bloom-js');
var bloomClient = new bloomjs.Client();
function searchAll(dataset, query, cb) {
var offset = 0;
(function searchMore(aggregate) {
bloomClient.search(dataset, query, { 'offset': offset, 'limit': 100 }, function (err, data, info) {
if (err) return cb(err);
data = data.concat(aggregate);
if (info.meta.rowCount > data.length) {
offset += 100;
searchMore(data);
} else {
cb(null, data);
}
});
})([]);
};
searchAll('usgov.hhs.npi', {'last_name': 'murillo'}, function (err, results) {
if (err) console.log(err.stack);
console.log(results.length);
});
Search HCPCS Procedure Codes for any code with word that starts with 'ambula' in the description' This also specifies an offset and limit using the options parameter.
bloomClient.search('usgov.hhs.hcpcs', {
'long_description': {
'prefix': 'ambula'
}
}, {
'offset': 0,
'limit': 10
}, function (error, response) {
if (error) return console.log(error.stack);
console.log('=== HCPCS code starting with ambula');
console.log('Code: ' + response[0].code);
});
Search for HCPCS codes with both the prefix 'ambula' and another word 'emer'
bloomClient.search('usgov.hhs.hcpcs', [
{
'long_description': { 'prefix': 'ambula' }
},
{
'long_description': { 'prefix': 'emer' }
}
], function (error, response, info) {
if (error) return console.log(error.stack);
console.log('=== HCPCS code starting with ambula AND emer');
console.log('Code: ' + response[0].code);
});
Search HCPCS for both code 'L8410' and 'C9289' (Logical OR)
bloomClient.search('usgov.hhs.hcpcs', {
'code': ['L8410', 'C9289']
}, function (error, response) {
if (error) return console.log(error.stack);
console.log('=== HCPCS code with codes L8410 or C9289');
console.log('Code: ' + response[0].code);
console.log('Code: ' + response[1].code);
});
Find a National Provider Identifier its NPI
bloomClient.find('usgov.hhs.hcpcs', 1770707127, function (error, response) {
if (error) return console.log(error.stack);
console.log('=== NPI details for 1770707127');
console.log('NPI: ' + response.npi);
});
FAQs
API Client for BloomAPI.
We found that bloom-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.