npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cbsodata

v0.0.9

Published

Retrieve data from the Open Data API of Statistics Netherlands (CBS)

Readme

CBS OData

Interface to CBS opendata. All data from the StatLine database of Statistics Netherlands can be retrieved.

Usage

All functions are asynchronous and can be used as a Promise or with a call back. If no callback parameter is given all api functions return a Promise object, otherwise the nodejs style callback function will be used.

Catalog: retrieving tables and themes

var catalog = require("cbsodata").catalog;

// retrieve list of tables asynchronously
catalog.get_tables( {Language: 'nl'} // filter on dutch tables
                  , function(error, tables){ nodejs style
                   // do your thing with the list of tables
                  });

// or use as a promise
catalog.get_tables( {Language: 'nl'})
.then(function(tables){
 // do your thing with the list of tables
}).catch(function(error){
  // do your thing with the error.
});


// retrieve list of themes asynchronously,, nodejs style
catalog.get_themes( {Language: 'en'} // filter on english themes
                  , null // select columns (array)
                  , function(error, themes){
                   // do your thing with the list of themes
                  });

Api: Get metadata and data from table

var api = require("cbsodata").api;

// retrieve metadata of table "81251ned" asynchronously
api.get_meta("81251ned").then(metadata){
  // do your thing with the meta data
});

//Note that at most 10 000 records can be retrieve with api
api.get_data( "81251ned", {Perioden: ['2009MM12']} // filter rows on values of 
            , null // select columns (array)
            )
.then(function(data){
// do your thing with the data
});

Bulk: Get metadata and bulk data download

var bulk = require("cbsodata").bulk;

// retrieve metadata of table "81251ned" asynchronously
bulk.get_meta("81251ned", function(error, metadata){
       // do your thing with the meta data
    });

bulk.get_data( "81251ned"
            , null // array with columns to select, null is all columns
            , {Perioden: ['2009MM12']} // filter rows
            , stream // stream to which will be written
            )