Skip to main content

A comprehensive, realiable API client for weheartit.

Project description

PyPI version PyPI license PRs Welcome GitHub issues Downloads Top Language Open Source Love png1


A fast, reliable API client for WeHeartIt.



weheartpy is an unofficial API client for weheartit

WeHeartIt does not have an API. So I have to make use of BeautifulSoup and requests to do my job. The speed is optimal, it has a limitation on number of results you can retreive through one search but its functional.


  • requires Python 10.* or above.
  • read the requirements here

you can easily install the packages using pip


pip install weheartpy


pip install git+


with weheartpy, you can search for:

  • posts aka entries
  • collections (including images inside them)
  • users
  • popular entries

I'm adding more functionalities and utilities later on, but this is all we got for now.


this is the most basic usage of the weheartpy module.

# import the main class
from weheartpy import WeHeartIt

whi = WeHeartIt() # create an instance of WeHeartIt

entries = whi.popular() # returns a list of recent popular images from homepage.

for entry in entries:
	print(entry.image, entry.views, entry.creator.username) # view the entry's contents
	print(entry.hearts, entry.title)"\images\cool_pic_from_weheartit.jpeg") # save the image from the post locally.
  • parameters - None

  • returns - List[Entry] a list of Entry objects which help you access the entries easier.

  • errors - ConnectionError

Posts / Entries

search for entries.

entries = whi.search_entries("mean girls", sort="most_popular")
# returns a list of entries relevant to your query.

for entry in entries:
	print(entry.username, entry.image, entry.url)
  • parameters - query - your search query

  • returns - List[Entry] a list of Entry objects which help you access the entries easier.

  • errors - ConnectionError


# return a list of `Collection` objects resulting from the query.

from weheartpy import WeHeartIt

whi = WeHeartIt()

cocs = whi.search_collections("anime pfp")
for c in cocs:
    collection = c.get_full_collection()
    print(collection.images, collection.description)

	# save the images from a collection to a folder:"\collection\")
	# images will be saved as "collection0.jpeg", "collection1.jpeg", etc.
  • parameters - query aka the search term
  • returns - List[Collection] Check out the documentation to see what else you can do with Collection objects.
  • errors - NoCollectionsFound


  • check out the documentation for more usages.
  • If you'd like to add something or fix mistakes, feel free to open an issue or a pull request.


  • v0.2.3 coming soon - hopefully featuring useragent and other improvements.
  • v0.2.2 - Big update, the library uses weheartit's natural API to bring Entry data.
    • this features a whole new ton of information you can use from entries such as a views, hearts, tags, titles and creation dates.
    • It also includes a .creator attribute which is a User object of the creator of the post.
    • If you notice anything slow, its the API calls to The IO time can be a pain if you have slow internet, nothing I can fix on my side.
  • v0.2.1 - Implement save feature, lets users save images locally.


  • Since this makeshift API client relies on the websites elements to remain unchanged, expect this package to break easily someday. useragent will be supported soon.
  • This package, code or software is made for educational purposes and does not intend to break any ToS of The creator/maintainer of this package will not be responsible for any actions done using the code. Use with your own caution and volition.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weheartpy-0.2.2.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

weheartpy-0.2.2-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page