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

node_perplexityai

v1.0.4

Published

An unofficial API for Node.js based off of the Perplexity.AI website and mobile app

Downloads

132

Readme

Perplexity.AI Unofficial Node API

An unofficial API for Node.js based off of the Perplexity.AI website and mobile app

Intro

This project is based off of an idea to make unofficial wrappers for AI sites that don't have an official API yet, and this idea is from the node_characterai package.

This project is not affiliated with Perplexity.AI in any way! It is a community project. The purpose of this project is to bring and build projects powered by Perplexity.AI.

If you like this project, please check their website.

Features

  • Fully written in Javascript and CommonJS
  • Asynchronous requests
  • Easy to use
  • Active development
  • Send messages to Perplexity.AI
  • Make the AI forget your message
  • Customize your answers with categories
  • Ask it basically anything

Installation

$ npm install node_perplexityai

And if you want to save it to your env:

$ npm install node_perplexityai --save

Usage

Here is a basic script that asks the AI a question:

const perplexity = require("node_perplexityai");

(async () => {
  // Ask the AI a question
  const answer = await perplexity.send("Can dogs eat chocolate?");
  console.log(answer);
})();

All of the functions are listed here:

const perplexity = require("node_perplexityai");

(async () => {
  // Ask the AI a question
  const answer1 = await perplexity.send("Who was the first person to step foot on The Moon?");

  console.log(answer1); // This logs the answer to your first question

  // List the available categories for asking questions (all, youtube, etc.)
  console.log(perplexity.categories);

  // Change the category of your next message
  await perplexity.category("wikipedia");

  // Ask the AI another question with the category "wikipedia"
  const answer2 = await perplexity.send("How tall is the One World Trade Center?");

  // Forgets your previous messages and resets the API
  await perplexity.forget();
})();

FAQ

| Question | Answer | | --- | --- | | Do I need an account? | Nope! You can ask unlimited questions to the AI for free. Account login features may be added in the future for better access to Perplexity. | | Error: No category found called "..." | You haven't selected the right category or have a typo. List the categories via perplexity.categories. | | Is this an official API? | No, this is a community-based project for building amazing projects using Perplexity.AI. | | Are there any limits to using this? | No, you can use this package for anything without any limits or signing up. Just make sure you don't violate the Perplexity.AI ToS. | | What does this package depend on? | The only dependency required is Puppeteer. It uses puppeteer to fetch the answer from the question sent to Perplexity.AI. It is installed automatically when installing this package. | | Other issue? | Report it in the Issues tab |

About Puppeteer

Any errors puppeteer related in this package can be reported in the Issues section, but please make note that if it is a full-on puppeteer related issue, I will close it.

TL;DR if the issue is puppeteer related, please post it in the Issues section but I may close it if it's not related to node_perplexityai

Support and Contribution

This project is updated frequently, always check for the latest version for new features or bug fixes.

If you have an issue or idea, let me know in the Issues tab. If you use this API, you also bound to the terms of usage of the Perplexity.AI website.

License

MIT

© 2021-2023 Parking Master