Helps to get IDs or screen names from links to social network accounts
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

IDs, please

Build Status ids_please API Documentation

IDs, Please

Grab some hidden in html data from social account page. Get social network IDs or screen names from links to social network accounts.

Sometimes you need to get a social network account name from a link. To store a screen name in your database instead of parsing the link every time, or maybe to work with these accounts using social network APIs (as I do). Would be easier to have a library that extracts this kind of information from all known social networks for your pleasure.

Amplifr Sponsored by Evil Martians


gem install ids_please

Or, put this in your Gemfile:

gem 'ids_please'


This gem works in two modes – you can get real data from social network by HTTP request and page parsing and you can just parse a link to social account to find username/id. Sometimes username from link can't be used with social network's API, in this case, try to get real ID with grab mode.

Grabbing data from social account's page

This functionality works through real HTTP requests, so if you feed it with many links – it can take a while.

As Facebook shows data only from public pages and public groups – in most cases you can't gather data from any profile page. Same thing about private Instagram accounts, profiles and private groups in vk.

Also, you should provide real URLs with right protocols. For example, you will not receive any data from, but from you'll receive all data as in example below:

ids ='', '')
=> {:instagram=>
      @data={:bio=>"The official Instagram account of Microsoft. Celebrating people who break boundaries, achieve their goals, and #DoMore every day.", :website=>""}],
      @data={:type=>"company", :description=>"Welcome to the official Microsoft Facebook page, your source for news and conversation about..."}

insta = ids.grabbed[:instagram].first
=> ""

Social networks supported for grabbing at the moment:

Link parsing

ids ='', '')
puts ids.parsed[:twitter]  # => ["gazay"]
puts ids.parsed[:facebook] # => ["alexey.gaziev"]

puts ids.original           # => ["", ""]

Or you can just check that the link is for a known social network:

ids ='', '')
puts ids.recognized   # => {:twitter=>[#<URI::HTTP:0x007fea3bba7e30 URL:>]}
puts ids.unrecognized # => [""]

Social networks supported at the moment:


  • @gazay

Special thanks to @ai, @yaroslav, @whitequark


Gem named under an impression of an awesome game called Papers, please.

Logo of gem also was inspired by its logo.

Thanks @dukope for allowing me to do this!


The MIT License