7

I searched the entire documentation for the Stack Exchange API v2.2, but could not find any API to get the data about the Impact section on the user page.

I am interested in the Impact/Number of People Reached data for a specific user.

One way to solve this problem is to GET the entire user page by using the URL: https://stackoverflow.com/users/${id} and using document.getElementById(), get the required data.

But the problem is, fetching the entire user page is bulky and not the optimal solution.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Deepak Tatyaji Ahire
  • 4,883
  • 2
  • 13
  • 35

2 Answers2

0

This is only possible via scraping users' profiles. Neither SE API nor SEDE provide a field with the number of people reached. You can only get the number of views a profile has received. It's the view_count field in the /users/{ids} method (not included in the filter by default) and the Views column in the Users table in SEDE. See the database schema for more details.

double-beep
  • 5,031
  • 17
  • 33
  • 41
0

One way to do it is

w3m -dump https://stackoverflow.com/users/[[USER ID]]/[[USER NAME]]\?tab\=topactivity | grep -izoP "(?s)[0-9]+(\.[0-9]+)?[kmb](?=\s(people)?\sreached)"

The reason why I use w3m is because it lifts the need to parse HTML tags, and the regex uses lookahead to make sure it's the number we're looking for, which at the time of writing this, is expected to be followed by the string reached or people.

ndrwnaguib
  • 5,623
  • 3
  • 28
  • 51