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 🙏

© 2024 – Pkg Stats / Ryan Hefner

flibusta

v0.5.1

Published

Unofficial Flibusta API based on website search engine. If you like to read books - buy

Downloads

9

Readme

Flibusta API

Unofficial Flibusta API based on website search engine.

NPM

Flibsta API is available as a npm packages

Use yarn add flibusta or npm install flibusta

Examples

  1. Clone repository
  2. Use yarn install or npm install
  3. Use commands:
yarn example-search-book-by-name [book name]
yarn example-search-authors [author name]
yarn example-search-book-by-series [series name]
yarn example-search-book-by-name-paginated [book name] [page number] [items limit count]
yarn example-search-authors-paginated [author name] [page number] [items limit count]
yarn example-search-book-by-series-paginated [series name] [page number] [items limit count]

API

getBooksByAuthorOpds(id)

  • id - The id of author
Example

getBooksByAuthorOpds(6116)

Response
[
  {
    "author": [
      {
        "name": "Конан Дойль Артур",
        "uri": "/a/6116"
      }
    ],
    "title": "«Глория Скотт»",
    "updated": "2022-02-22T08:35:39+01:00",
    "categories": [
      "Классический детектив"
    ],
    "cover": "/i/0/214600/cover.jpg",
    "downloads": [
      {
        "link": "/b/214600/fb2",
        "type": "application/fb2+zip"
      },
      {
        "link": "/b/214600/html",
        "type": "application/html+zip"
      },
      {
        "link": "/b/214600/txt",
        "type": "application/txt+zip"
      },
      {
        "link": "/b/214600/rtf",
        "type": "application/rtf+zip"
      },
      {
        "link": "/b/214600/mobi",
        "type": "application/x-mobipocket-ebook"
      }
    ],
    "description": "<p class=book>Куда исчез фаворит предстоящих скачек жеребец Серебряный и кто убил его тренера? Кто пытается разлучить счастливых супругов Мунро и что за ужасное лицо появляется в окне соседнего дома? В какую аферу оказался вовлечен незадачливый биржевой маклер? И что делали таинственные гости из России в комнате пациента доктора Тревельяна? На эти вопросы берется ответить знаменитый Шерлок Холмс... </p>\n   <br/>Перевод: Любимова Галина<br/>Формат: fb2<br/>Язык: ru<br/>Размер: 62 Kb<br/>Скачиваний: 8387<br/>Серия: Рассказы о Шерлоке Холмсе — 2. Записки о Шерлоке Холмсе #4<br/>"
  },
  ...
]

getBooksByAuthorOpdsPaginated(id)

  • id - The id of author
  • page? - Optional to get books by name for page. By default 0.
  • limit? - Optional. Limit rows count in items. By default 20.
Example

getBooksByAuthorOpdsPaginated(6116)

Response
{
  "items": [
    {
      "author": [
        {
          "name": "Конан Дойль Артур",
          "uri": "/a/6116"
        }
      ],
      "title": "«Глория Скотт»",
      "updated": "2022-02-22T08:35:39+01:00",
      "categories": [
        "Классический детектив"
      ],
      "cover": "/i/0/214600/cover.jpg",
      "downloads": [
        {
          "link": "/b/214600/fb2",
          "type": "application/fb2+zip"
        },
        {
          "link": "/b/214600/html",
          "type": "application/html+zip"
        },
        {
          "link": "/b/214600/txt",
          "type": "application/txt+zip"
        },
        {
          "link": "/b/214600/rtf",
          "type": "application/rtf+zip"
        },
        {
          "link": "/b/214600/mobi",
          "type": "application/x-mobipocket-ebook"
        }
      ],
      "description": "<p class=book>Куда исчез фаворит предстоящих скачек жеребец Серебряный и кто убил его тренера? Кто пытается разлучить счастливых супругов Мунро и что за ужасное лицо появляется в окне соседнего дома? В какую аферу оказался вовлечен незадачливый биржевой маклер? И что делали таинственные гости из России в комнате пациента доктора Тревельяна? На эти вопросы берется ответить знаменитый Шерлок Холмс... </p>\n   <br/>Перевод: Любимова Галина<br/>Формат: fb2<br/>Язык: ru<br/>Размер: 62 Kb<br/>Скачиваний: 8387<br/>Серия: Рассказы о Шерлоке Холмсе — 2. Записки о Шерлоке Холмсе #4<br/>"
    },
    ...
  ],
  "currentPage": 0,
  "hasNextPage": true,
  "hasPreviousPage": false
}

getBooksByName(name)

  • name - The name of searched books.
Example

getBooksByName('Шерлок')

Response
[
  {
    "book": {
      "id": 402475,
      "name": "Шерлок Холмс и дело о папирусе (сборник) [= Шерлок Холмс против графа Дракулы (сборник)]"
    },
    "authors": [
      {
        "id": 33441,
        "name": "Дэвид Стюарт Дэвис"
      }
    ]
  },
  ...
]

getBooksByNameFromOpds(name)

  • name - The name of searched books.
Example

getBooksByNameFromOpds('Шерлок')

Response
[
  {
    "author": [
      {
        "name": "Талышханов Адиль",
        "uri": "/a/31745"
      }
    ],
    "title": "`Путь бесхвостой птички` или Иероглифика по методу Шерлока Холмса",
    "updated": "2022-02-18T07:21:09+01:00",
    "categories": [
      "Языкознание, иностранные языки"
    ],
    "downloads": [
      {
        "link": "/b/112478/download",
        "type": "application/pdf+rar"
      }
    ],
    "description": "Формат: pdf<br/>Язык: ru<br/>Размер: 564 Kb<br/>Скачиваний: 2632<br/>"
  },
  ...
]

getBooksByNameFromOpdsPaginated(name, page?, limit?)

  • name - The name of searched books.
  • page? - Optional to get books by name for page. By default 0.
  • limit? - Optional. Limit rows count in items. By default 20.
Example

getBooksByNameFromOpdsPaginated('Шерлок', 0, 1)

Response
{
  "items": [
    {
      "author": [
        {
          "name": "Талышханов Адиль",
          "uri": "/a/31745"
        }
      ],
      "title": "`Путь бесхвостой птички` или Иероглифика по методу Шерлока Холмса",
      "updated": "2022-02-18T18:01:50+01:00",
      "categories": [
        "Языкознание, иностранные языки"
      ],
      "downloads": [
        {
          "link": "/b/112478/download",
          "type": "application/pdf+rar"
        }
      ],
      "description": "Формат: pdf<br/>Язык: ru<br/>Размер: 564 Kb<br/>Скачиваний: 2632<br/>"
    }
  ],
  "currentPage": 0,
  "totalCountItems": 228,
  "hasNextPage": true,
  "hasPreviousPage": false,
  "totalPages": 11
}

getBooksByNamePaginated(name, page?, limit?)

  • name - The name of searched books.
  • page? - Optional to get books by name for page. By default 0.
  • limit? - Optional. Limit rows count in items. By default 50.
Example

getBooksByNamePaginated('Шерлок', 0, 1)

Response
{
  "items": [
    {
      "book": {
        "id": 402475,
        "name": "Шерлок Холмс и дело о папирусе (сборник) [= Шерлок Холмс против графа Дракулы (сборник)]"
      },
      "authors": [
        {
          "id": 33441,
          "name": "Дэвид Стюарт Дэвис"
        }
      ]
    }
  ],
  "currentPage": 0,
  "totalCountItems": 228,
  "totalPages": 5,
  "hasNextPage": true,
  "hasPreviousPage": false
}

getBooksBySeries(name, page?, limit?)

  • name - The name of searched books series.
Example

getBooksBySeries('Шерлок')

Response
[
  {
    "id": 242,
    "name": "Шерлок Холмс с иллюстрациями",
    "books": 11
  },
  {
    "id": 30097,
    "name": "Шерлок Холмс. Игра продолжается",
    "books": 61
  },
  {
    "id": 4154,
    "name": "Шерлок Холмс. Новые приключения",
    "books": 8
  },
  ...
]

getBooksBySeriesPaginated(name, page?, limit?)

  • name - The name of searched books series.
  • page? - Optional to get books by name for page. By default 0.
  • limit? - Optional. Limit rows count in items. By default 50.
Example

getBooksBySeriesPaginated('Шерлок', 0, 1)

Response
{
  "items": [
    {
      "id": 242,
      "name": "Шерлок Холмс с иллюстрациями",
      "books": 11
    }
  ],
  "currentPage": 0,
  "totalCountItems": 39,
  "totalPages": 1,
  "hasNextPage": false,
  "hasPreviousPage": false
}

getAuthors(name)

  • name - The name of searched author.
Example

getAuthors('конан')

Response
[
  {
    "id": 6116,
    "name": "Артур Конан Дойль",
    "books": 584,
    "translations": -1
  },
  {
    "id": 17933,
    "name": "Адриан Конан Дойл",
    "books": 37,
    "translations": -1
  },
  {
    "id": 147059,
    "name": "Андреас Конанос (архимандрит)",
    "books": 19,
    "translations": -1
  },
  {
    "id": 6118,
    "name": "Сьюзан Конант",
    "books": 4,
    "translations": -1
  },
  {
    "id": 58754,
    "name": "Александр Конаныхин",
    "books": -1,
    "translations": 1
  }
]

getAuthorsPaginated(name, page?, limit?)

  • name - The name of searched author.
  • page? - Optional to get books by name for page. By default 0.
  • limit? - Optional. Limit rows count in items. By default 50.
Example

getAuthorsPaginated('конан', 0, 1)

Response
{
  "items": [
    {
      "id": 6116,
      "name": "Артур Конан Дойль",
      "books": 584,
      "translations": -1
    }
  ],
  "currentPage": 0,
  "totalCountItems": 5,
  "totalPages": 1,
  "hasNextPage": false,
  "hasPreviousPage": false
}

getCoverByBookId(id)

  • id - The book id
Example

getCoverByBookId(226302)

Response
File blob

getGenres(name)

  • name - The name of searched genre.
Example

getGenres('роман')

Response
[
  {
    "id": "det_irony",
    "name": "Иронический детектив, дамский детективный роман"
  },
  {
    "id": "love_contemporary",
    "name": "Современные любовные романы"
  },
  {
    "id": "love_history",
    "name": "Исторические любовные романы"
  },
  {
    "id": "love_detective",
    "name": "Остросюжетные любовные романы"
  },
  {
    "id": "love_short",
    "name": "Короткие любовные романы"
  },
  {
    "id": "love",
    "name": "Любовные романы"
  },
  {
    "id": "love_sf",
    "name": "Любовное фэнтези, любовно-фантастические романы "
  },
  {
    "id": "tale_chivalry",
    "name": "Рыцарский роман"
  },
  {
    "id": "adv_story",
    "name": "Авантюрный роман"
  },
  {
    "id": "gothic_novel",
    "name": "Готический роман"
  },
  {
    "id": "great_story",
    "name": "Роман, повесть"
  },
  {
    "id": "astrology",
    "name": "Астрология и хиромантия"
  }
]

getGenresPaginated(name, page?, limit?)

  • name - The name of searched genre.
  • page? - Optional to get books by name for page. By default 0.
  • limit? - Optional. Limit rows count in items. By default 50.
Example

getGenresPaginated('роман', 0, 2)

Response
{
  "items": [
    {
      "id": "det_irony",
      "name": "Иронический детектив, дамский детективный роман"
    },
    {
      "id": "love_contemporary",
      "name": "Современные любовные романы"
    }
  ],
  "currentPage": 0,
  "totalCountItems": 12,
  "totalPages": 1,
  "hasNextPage": false,
  "hasPreviousPage": false
}

Onion Support

Thanks antis11 for an example

import { SocksProxyAgent } from 'socks-proxy-agent';

import FlibustaAPI from 'flibusta';

(async () => {
  // eslint-disable-next-line unicorn/no-unreadable-array-destructuring
  const [/* original value */, /* path to the file */, authorName] = process.argv;

  const flibustaApi = new FlibustaAPI('http://flibustaongezhld6dibs2dps6vm4nvqg2kp7vgowbu76tzopgnhazqd.onion', {
    httpAgent: new SocksProxyAgent('socks5h://127.0.0.1:9050'),
  });

  const searchAuthorsResult = await flibustaApi.getAuthors(authorName);
  
  console.log(JSON.stringify(searchAuthorsResult, undefined, 2));
})();