An AI-based tool for monitoring facebook marketplace
- GitHub repo: https://github.com/BoPeng/ai-marketplace-monitor.git
- Documentation: https://ai-marketplace-monitor.readthedocs.io
- Free software: MIT
This program
- Starts a browser (can be in headless mode)
- Search one or more products
- Notify one or more users of new products with phone notification
- Search for one or more products using specified keywords.
- Limit search by minimum and maximum price, and location.
- Exclude irrelevant results.
- Exclude explicitly listed spammers.
- Exclude by description.
- Exclude previously searched items and only notify about new items.
- Send notifications via PushBullet.
- Search repeatedly with specified intervals in between.
- Add/remove items dynamically by changing the configuration file.
TODO:
- Use embedding-based algorithms to identify likely matches.
- Use AI to identify spammers.
- Support other notification methods.
- Support other marketplaces.
NOTE: This is a tool for programmers, and you are expected to know some Python and command-line operations to make it work. There is no GUI.
Install the program by
pip install ai-marketplace-monitor
Install a browser for Playwright using the command:
playwright install
- Sign up for PushBullet
- Install the app on your phone
- Go to the PushBullet website and obtain a token
A minimal example is provided as minimal_config.toml
. Basically you will need to let the program know which city you are searching in, what item you are searching for, and how you want to get notified.
[marketplace.facebook]
username = 'username'
password = 'password'
search_city = 'houston'
[item.name]
keywords = 'search word one'
[user.user1]
pushbullet_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
A more complete example is provided at example_config.toml
, which allows for more complex search and notification patterns. Briefly:
-
marketplace.facebook
allowsusername
: (required)password
: (required)login_wait_time
: (optional), time to wait before searching in seconds, to give you enough time to enter CAPTCHA, default to 60.search_interval
: (optional) minimal interval in minutes between searchesmax_search_interval
: (optional) maximum interval in minutes between searchessearch_city
: (optional if defined for item) search city, which can be obtained from the URL of your search queryacceptable_locations
: (optional) only allow searched items from these locationsexclude_sellers
: (optional) exclude certain sellers by their names (not username)min_price
: (optional) minimum price.max_price
: (optional) maximum price.notify
: (optional) users who should be notified for all items
-
user.username
whereusername
is the name listed innotify
pushbullet_token
: (rquired) token for user
-
item.item_name
whereitem_name
is the name of the itemkeywords
: (required) one of more keywords for searching the itemmarketplace
: (optional), can only befacebook
if specified.exclude_keywords
: (optional), exclude item if the title contain any of the specified wordsexclude_sellers
: (optional, not implemented yet) exclude certain sellersmin_price
: (optional) minimum price.max_price
: (optional) maximum price.exclude_by_description
: (optional) exclude items with descriptions containing any of the specified words.notify
: (optional) users who should be notified for this item
Start monitoring with the command
ai-marketplace-monitor
or
ai-marketplace-monitor --config /path/to/config.toml
NOTE
- You need to keep the terminal running to allow the program to run indefinitely.
- You will see a browser firing up. You may need to manually enter any prompt (e.g. CAPTCHA) that facebook asks for authentication in addition to the username and password that the program enters for you. You may want to click "OK" to save the password, etc.
- A file
~/.ai-marketplace-monitor/config.yml
, if it exists, will be read and merged with the specified configuration file. This allows you to save sensitive information like Facebook username, password, and PushBullet token in a separate file. - Multiple configuration files can be specified to
--config
, which allows you to spread items into different files.
- Some of the code was copied from facebook-marketplace-scraper.
- This package was created with Cookiecutter and the cookiecutter-modern-pypackage project template.