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

quora-api

v1.0.1

Published

An unofficial API for Quora

Downloads

20

Readme

:boom: :book: :boom: An unofficial API for Quora.

Build Status code-style

NOTE : Quora changes its UI almost every day. They make changes, they revert it back. This is what they are doing. This code worked very well on old structure, but now some of the feature aren't working well. Also, Quora removed few sections like Highlights and Views but this api contains that part which is quite useless at this point of time.

Install

$ npm install --save quora-api

Usage

PART 1 : STATS

Basic Information : quora()

accepts : username

'use strict';

const quora = require('quora-api');

quora('Adam-DAngelo').then(user => {
	console.log(user);
     /*
	{ profilePicture: 'https://qph.ec.quoracdn.net/...yqigr.jpeg',
	  biography: 'Quora CEO',
      fullBio: null,
      publicAnswers: '956',
      questions: '951',
      posts: '60',
      followers: '160,138',
      following: '619',
      edits: '21,076',
      monthlyViews: '383,356',
      totalViews: '16,488,317' }
    */
});

Knows About : quora.knowsAbout()

accepts : username

quora.knowsAbout('Adam-DAngelo').then(user => {
	console.log(user);
	/*
	{ knowsAbout1: 'Startups',
	answers1: '63',
	endorsement1: '95',
	knowsAbout2: 'Quora (company)',
	answers2: '37',
	endorsement2: '268',
	knowsAbout3: 'California Institute of Technology',
	answers3: '9',
	endorsement3: '48' }
	*/
});

Highlights : quora.highlights()

accepts : username

quora.hightlights('Adam-DAngelo').then(info => {
	console.log(user);
	/*
	{ info1: 'Top Writer',
  	  part1: '2016, 2015, 2014, and 2013',
  	  info2: 'Knowledge Prize Winner',
  	  part2: 'Insert a dynamic date here',
  	  info3: 'Published Writer',
  	  part3: 'Forbes',
  	  info4: 'Most Viewed Writer',
  	  part4: ' Palo Alto, CA,  Quora,  California Institute of Technology, and 29 more' }
  	*/
});

PART 2 : BLOGS & ANSWERS

General answers : quora.answer()

accepts : question [without https://quora.com/]

answer's count : 5 (max)

quora.answer('What-is-JavaScript').then(answer => {
	console.log(answer);
	/*
	{ answer0: 'Well, when you go to a.....case of AJAX calls, etc',
	  writer0: 'Josh Beam',
	  answer1: 'Your intuition about Javascript.....great JS codes',
	  writer1: 'Justen Robertson',
	  answer2: 'As stated in this..... page JavaScript: JavaScript',
	  writer2: 'Yassine Alouini',
	  answer3: 'JavaScript is a prog.... JSalert(\'Hello, world!\');'
	  writer3: 'Faizaan Mohammed';
	  answer4: 'I strongly suggest you to read.....ES6 and Beyond.',
	  writer4: ''Kim Gysen' }
	/*
});

User's answer : quora.answer.user()

accepts : question along with writer's name

quora.answer.user('What-was-the-first-program-Adam-DAngelo-wrote/answer/Adam-DAngelo').then(answer => {
	console.log(answer);
	/*
	{ answer: 'I'm not sure if I remember exactly. . . about programming' }
	/*
});

Total answers on a question : quora.answer.count()

accepts : question

quora.answer.count('Where-do-Congressmen-and-Senators-live-when-they-are-in-DC').then(count => {
	console.log(count);
	// { count: '8 Answers' }
});

User's total blog : quora.blogCount()

accepts : username

quora.blogCount('Adam-DAngelo').then(count => {
	console.log(count);
	// { blog: '16 Blogs' }
});

PART 3 : USER's ACTIVITIES

Track last 5 activities : quora.activity()

accepts : username

quora.activity('Adam-DAngelo').then(track => {
	console.log(track);
	/*
	{ question0: 'Where do Congressmen and Senators live when they are in DC?',
	  action0: '  Adam D\'Angelo upvoted this · 18h ago',
	  .
	  .
	  question4: 'Is service (at restaurants, stores, taxis, etc.) good or bad in Israel?',
	  action4: 'Adam D\'Angelo upvoted this · 1d ago' }
	*/
});

›› You can also use :

quora.activity.asked(username) : last 5 questions asked by an user

quora.activity.asked(username).then(data => {
	console.log(data);
	// => get data
});

quora.activity.answered(username) : last 5 questions answered by an user

quora.activity.answered(username).then(data => {
	console.log(data);
	// => get data
});

Options

›› Datas of section "Basic Information" can also be scrapped individually

quora.profileImage(username) : get username of a quora user

quora.bio(username) : get initial biography

quora.fullBio(username) : get complete biography

quora.publicAnswers(username) : total publically answered question's count

quora.questions(username) : total publically asked questions's count

quora.posts(username) : total blog posts made

quora.followers(username) : total number of followers

quora.following(username) : total following

quora.edits(username) : total edits made by a user

quora.monthlyViews(username) : views generated on user's answer - monthly

quora.totalViews(username) : views generate on user's answers - all time

  • username

TYPE : string

Contributing

Feel free to submit a pull request or an issue! :hearts:

License

MIT © Rishi Giri