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

willhaben

v0.2.1

Published

This module has only tested on `https://willhaben.at`!

Readme

Willhaben API

This module has only tested on https://willhaben.at!

Documentation

There are two ways you can use this API. Either by entering the URL and let the API extract all the results or by using the builder to build the URL and let the API extract the results.

Extract results directly from URL

For this method you need an URL of the willhaben search you want to make. Then you use the .getListings(URL) function and it returns a promise which resolves to an array with all the results.

Example

This example searches for rtx in the Grafikkarten category and will show the first 1000 results.

const willhaben = require('willhaben')

willhaben.getListings('https://www.willhaben.at/iad/kaufen-und-verkaufen/marktplatz/pc-komponenten/-5882?keyword=rtx&rows=1000').then(json => {
    console.log(json)
})

Use builder to build URL and get results

The URL builder is obtainable with the .new() function. Then you can use various methods on the object and execute the search with .search(). This method returns a promise which resolves to an array containing all the results.

Available methods in the builder: Method | Description ------------ | ------------- .category(int) | sets the category to search (default: all) .condition(int) | adds a condition to search .transferType(int) | adds a transfer type to search .count(int) | sets the count of how many results should be searched for .paylivery(boolean) | sets if you should search for PayLivery .keyword(string) | sets the keyword to search for (basically a text search) .getURL() | get URL with the currently set variables .search() | executes search -> returns Promise

Getting constants There are constants for the categories, conditions, and transfer types. The contants are saved as properties of the module object. Example:

const willhaben = require('willhaben')

console.log(willhaben.getCategories.grafikkarten)

Property | Constant Description ------------ | ------------- .getCategories | get the integer for a category .getConditions | get the integer for a condition .getTransferTypes | get the integer for a transfer type

Example

This example searches for rtx in the Grafikkarten category and will show the first 1000 results. (same example as above)

const willhaben = require('willhaben')

willhaben.new()
    .keyword('rtx')
    .count(1000) // default is 1000
    .category(willhaben.getCategories.grafikkarten)
    .search().then(json => {
        console.log(json)
    })