Configuration Reference
Table of content:
- AI Services
- Marketplaces
- Users
- Notification
- Email notification
- Items to search
- Common item and marketplace options
- Regions
- Translators
- Monitor Configuration
- Additional options
The AI Marketplace Monitor uses TOML configuration files to control its behavior. The system will always check for a configuration file at ~/.ai-marketplace-monitor/config.toml. You can specify additional configuration files using the --config option.
To avoid including sensitive information directly in the configuration file, all options that accept a string or a list of string can be specified using the ${ENV_VAR} format. For example
[marketplace.facebook]
password = '${FACEBOOK_PASSWORD}'
[user.me]
email = ['${EMAIL_1}', '${EMAIL_2}']
pushbullet_token = '${PUSBULLET_TOKEN}'
AI Marketplace Monitor will retrieve the value from the corresponding environment variable and raise an error if the environment variable does not exist.
Here is a complete list of options that are acceptable by the program. example_config.toml provides an example with many of the options.
AI Services
One of more sections to list the AI agent that can be used to judge if listings match your selection criteria. The options should have header such as [ai.openai] or [ai.deepseek], and have the following keys:
| Option | Requirement | DataType | Description |
|---|---|---|---|
provider |
Optional | String | Name of the AI service provider. |
api-key |
Optional | String | A program token to access the RESTful API. |
base_url |
Optional | String | URL for the RESTful API |
model |
Optional | String | Language model to be used. |
max_retries |
Optional | Integer | Max retry attempts if connection fails. Default to 10. |
timeout |
Optional | Integer | Timeout (in seconds) waiting for response from AI service. |
Note that:
providercan be OpenAI, DeepSeek, or Ollama. The name of the ai service will be used if this option is not specified soOpenAIwill be used for sectionai.openai.- OpenAI and DeepSeek models sets default
base_urlandmodelfor these providers. - Ollama models require
base_url. A default model is set todeepseek-r1:14b, which seems to be good enough for this application. You can of course try other models by setting themodeloption. - Although only three providers are supported, you can use any other service provider with
OpenAI-compatible API using customizedbase_url,model, andapi-key. - You can use option
aito list the AI services for particular marketplaces or items.
A typical section for OpenAI looks like
[ai.openai]
api_key = 'sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Marketplaces
One or more sections marketplace.name show the options for interacting with various marketplaces.
| Option | Requirement | DataType | Description |
|---|---|---|---|
market_type |
Optional | String | The supported marketplace. Currently, only facebook is supported. |
username |
Optional | String | Username can be entered manually or kept in the config file. |
password |
Optional | String | Password can be entered manually or kept in the config file. |
login_wait_time |
Optional | Integer | Time (in seconds) to wait before searching to allow enough time to enter CAPTCHA. Defaults to 60. |
language |
Optional | String | Language for webpages |
| Common options | Options listed in the Common options section below that provide default values for all items. |
- Multiple marketplaces with different
names can be specified for differentitems (see Multiple marketplaces). However, because the defaultmarketplacefor all items arefacebook, it is easiest to define a default marketplace calledmarketplace.facebook. - If
language="LAN"is specified, it must match to one oftranslationsections, defined by yourself or in the system configuration file. The system will try exact match (e.g.estoesorzh_CNtozh_CN), then partial match (e.g.estoes_COores_COtoes). - Please see Support for non-English languages on how to set this option and define your own translations.
Users
One or more user.username sections can be defined in the configuration. The username one of the usernames listed in the notify option of marketplace or item. Each user section accepts the following options
| Option | Requirement | DataType | Description |
|---|---|---|---|
notify_with |
Optional | String/List | Specifies one or more notification methods to be used for this user. If left unspecified, all available notification methods will be used. |
remind |
Optional | String | Enables repeated notifications for the user after a specified duration (e.g., 3 days) if a listing remains active. By default, users are notified only once. |
Note that
- Default Notification Behavior: If the
notify_withoption is not specified, the system will use all available notification methods for the user. - Inline Notification Settings: Notification settings can be defined directly under the user section. Any settings described in the Notification section can be applied to a user's configuration.
- Repeated Notifications: The
remindoption allows users to receive repeated notifications after a specified time interval. If not set, users will only be notified once about a listing.
Notification
AI Marketplace Monitor supports various notification methods, allowing you to configure notifications in a flexible way. You can define notification settings directly within the user sections or create dedicated notification.NAME sections and reference them using the notify_with option. This provides flexibility for single-user setups or shared configurations across multiple users.
Direct Notification Settings in User Sections
Define notification details directly within the user section. This approach is ideal for single-user configurations.
[user.me]
pushbullet_token = "xxxxxxxxxxxxxxxx"
email = 'myemail@gmail.com'
smtp_password = 'abcdefghijklmnop'
Shared Notification Settings in Dedicated Sections
Define notification methods in their own notification.NAME sections and reference them using the notify_with option. This approach is better for sharing settings across multiple users.
[user.me]
email = 'myemail@gmail.com'
notify_with = ['gmail', 'pushbullet']
[user.other]
email = 'other.email@gmail.com'
notify_with = ['gmail']
[notification.gmail]
smtp_password = 'abcdefghijklmnop'
[notification.pushbullet]
pushbullet_token = "xxxxxxxxxxxxxxxx"
Note that:
- Under the hood, AI Marketplace Monitor merges all notification options into the user section. This allows you to share partial settings across users (e.g.
smtp_password) while customizing specific details (e.g.email). - If
notify_withis not specified, the system will automatically include all notification settings for the user, so thenotify_withoption foruser.mecould be ignored. - AI Marketplace Monitor does not support multiple notifications of the same type for a single user. For example, the following configuration is not supported:
[user.me]
notify_with = ['pushbullet1', 'pushbullet2']
If you need to send notifications through multiple instances of the same type (e.g., multiple Pushbullet tokens), you must create separate users for each instance. For example:
[user.me]
notify_with = 'pushbullet1'
[user.other]
notify_with = 'pushbullet2'
[notification.pushbullet1]
pushbullet_token = "xxxxxxxxxxxxxxxx"
[notification.pushbullet2]
pushbullet_token = "yyyyyyyyyyyyyyyy"
Common Notification settings
| Option | Requirement | DataType | Description |
|---|---|---|---|
max_retries |
Optional | Integer | Number of attempts to retry a notification. Defaults to 5. |
retry_delay |
Optional | Integer | Time in seconds to wait between retry attempts. Defaults to 60. |
with_description |
Optional | Boolean/Integer | Whether or not include description of listings. If a number is given, the description will be truncated to the specified length. |
Note that
- These settings are shared across all notification methods. For example, if you are notifying with
notify_with=['gmail', 'pushbullet'], the samemax_retriesandretry_delaywill apply to both methods. - Support for
with_descriptionvary across notification methods due to their own limitations and strenght. For example, email notification will always include description.
Pushbullet notification
| Option | Requirement | DataType | Description |
|---|---|---|---|
pushbullet_token |
Optional | String | Token for user. |
pushbullet_proxy_type |
Optional | String | HTTP proxy type, e.g. https |
pushbullet_proxy_server |
Optional | String | HTTP proxy server URL |
Please refer to PushBullet documentation for details on the use of a proxy server for pushbullet.
Pushover notification
| Option | Requirement | DataType | Description |
|---|---|---|---|
pushover_user_key |
Optional | String | Pushover user key. |
pushover_api_token |
Optional | String | Pushover API Token. |
Pushover notification
| Option | Requirement | DataType | Description |
|---|---|---|---|
ntfy_server |
Optional | String | ntfy server, default to https://ntfy.sh |
ntfy_topic |
Optional | String | A unique topic to receive your notification. |
message_format |
Optional | String | Format notification as plain_text or markdown |
- According to ntfy documentation, markdown format is supported only by web app. Therefore,
message_formatis by default set toplain_text.
Email notification
| Option | Requirement | DataType | Description |
|---|---|---|---|
email |
Optional | String/List | One or more email addresses for email notifications |
smtp_username |
Optional | String | SMTP username. |
smtp_password |
Required | String | A password or passcode for the SMTP server. |
smtp_server |
Optional | String | SMTP server, usually guessed from sender email address. |
smtp_port |
Optional | Integer | SMTP port, default to 587 |
Note that
- We provide default
smtp_serverandsmtp_portvalues for popular SMTP service providers. smtp_usernameis assumed to be the firstemail.
See Setting up email notification for details on how to set up email notification.
Items to search
One or more item.item_name where item_name is the name of the item.
| Option | Requirement | DataType | Description |
|---|---|---|---|
search_phrases |
Required | String/List | One or more strings for searching the item. |
description |
Optional | String | A longer description of the item that better describes your requirements (e.g., manufacture, condition, location, seller reputation, shipping options). Only used if AI assistance is enabled. |
keywords |
Optional | String/List | Excludes listings whose titles and description do not contain any of the keywords. |
antikeywords |
Optional | String/List | Excludes listings whose titles or descriptions contain any of the specified keywords. |
marketplace |
Optional | String | Name of the marketplace, default to facebook that points to a marketplace.facebook sectiion. |
| Common options | Options listed below. These options, if specified in the item section, will override options in the marketplace section. |
Marketplaces may return listings that are completely unrelated to search search_phrases, but can also return related items under different names. To select the right items, you can
- Use
keywordsto keep only items with certain words in the title. For example, you can setkeywords = ['gopro', 'go pro']when you search forsearch_phrases = 'gopro'. - Use
antikeywordsto narrow down the search. For example, settingantikeywords=['HERO 4']will exclude items withHERO 4orhero 4in the title or description. - The
keywordsandantikeywordsoptions allows the specification of multiple keywords with aORrelationship, but it also allows complexAND,ORandNOTlogics. See Advanced Keyword-based filters for details. - It is usually more effective to write a longer
descriptionand let the AI know what exactly you want. This will make sure that you will not get a drone when you are looking for aDJIcamera. It is still a good idea to pre-filter listings using non-AI criteria to reduce the cost of AI services.
Common item and marketplace options
The following options that can specified for both marketplace sections and item sections. Values in the item section will override value in corresponding marketplace if specified in both places.
Parameter |
Required/Optional | Datatype | Description |
|---|---|---|---|
availability |
Optional | String/List | Shows output with in (in stock), out (out of stock), or all (both). |
condition |
Optional | String/List | One or more of new, used_like_new, used_good, and used_fair. |
date_listed |
Optional | String/Integer/List | One of all, last 24 hours, last 7 days, last 30 days, or 0, 1, 7, and 30. |
delivery_method |
Optional | String/List | One of all, local_pick_up, and shipping. |
exclude_sellers |
Optional | String/List | Exclude certain sellers by their names (not username). |
max_price |
Optional | Integer/String | Maximum price, can be followed by a currency name. |
max_search_interval |
Optional | String | Maximum interval in seconds between searches. If specified, a random time will be chosen between search_interval and max_search_interval. |
min_price |
Optional | Integer/String | Minimum price, can be followed by a currency name. |
category |
Optional | String | Category of search. |
notify |
Optional | String/List | Users who should be notified. |
ai |
Optional | String/List | AI services to use, default to all specified services. ai=[] will disable ai. |
city_name |
Optional | String/List | Corresponding name of search_city. |
radius |
Optional | Integer/List | Radius of search, can be a list if multiple search_city are specified. |
currency |
Optional | Integer/List | Currency used for the search city, can be a list if multiple search_city are specified. |
prompt |
Optional | String | Prompt to AI service that will replace the default prompt |
extra_prompt |
Optional | String | Additional prompt that will be inserted between regular and rating prompt |
ranking_prompt |
Optional | String | Ranking prompt that instruct how AI rates the listings |
rating |
Optional | Integer/List | Notify users with listings with rating at or higher than specified rating. |
search_city |
Required | String/List | One or more search cities, obtained from the URL of your search query. Required for marketplace or item if search_region is unspecified. |
search_interval |
Optional | String | Minimal interval between searches, should be specified in formats such as 1d, 5h, or 1h 30m. |
search_region |
Optional | String/List | Search over multiple locations to cover an entire region. regions should be one or more pre-defined regions or regions defined in the configuration file. |
seller_locations |
Optional | String/List | Only allow searched items from these locations. |
start_at |
Optional | String/List | Time to start the search. Overrides search_interval. |
Note that
search_citycan be found from the URL that facebook uses to search your region. For example, if the URL for your facebook search ishttps://www.facebook.com/marketplace/sanfrancisco/search?query=go%20pro%2011%20deal%20site, thesearch_cityissanfrancisco. This name is not necessarily the name of your city, especially for non-US cities, and you can search multiple cities or an entire region. See Searching multiple cities and regions for details.- If
notifyis not specified for bothitemandmarketplace, all listed users will be notified. prompt,extra_prompt,rating_prompt, andratingare used to adjust how to interact with an AI service. See Adjust prompt and notification level for details.start_atsupports one or more of the following values:
-HH:MM:SSorHH:MMfor every day atHH:MM:SSorHH:MM:00
-*:MM:SSor*:MMfor every hour atMM:SSorMM:00
-*:*:SSfor every minute atSS.- A list of two values can be specified for options
rating,availability,delivery_method, anddate_listed. See First and subsequent searches for details. min_priceandmax_pricecan be specified as a number (e.g.min_price=100) or a number followed by a currency name (e.g.min_price='100 USD'). If different currencies are specified for bothmin_price/max_priceandsearch_city(orregion), themin_priceandmax_pricewill be adjusted to use currency for thesearch_city. See Searching across regions with different currencies for details.categorycan bevehicles,propertyrentals,apparel,electronics,entertainment,family,freestuff,free,garden,hobbies,homegoods,homeimprovement,homesales,musicalinstruments,officesupplies,petsupplies,sportinggoods,tickets,toys, andvideogames. Ifcatgory=freestufforcatgory=freeis set,min_priceandmax_priceis ignored.
Regions
One or more sections of [region.region_name], which defines regions to search. Multiple searches will be performed for multiple cities to cover entire regions.
| Parameter | Required/Optional | Data Type | Description |
|---|---|---|---|
search_city |
Required | String/List | One or more cities with names used by Facebook. |
full_name |
Optional | String | A display name for the region. |
radius |
Optional | Integer/List | Recommended 805 for regions using kms, and 500 for regions using miles. |
currency |
Optional | Integer/List | Currency used for the region. |
city_name |
Optional | String/List | Corresponding names for search_city. |
Note that
radiushas a default value of500(miles). You can specify differentradiusfor differentsearch_city.- Options
full_nameandcity_nameare for documentation and logging purposes only.
Translators
A translator contains a list of word mappings that translate English words to corresponding words in another language. They are used by AI Marketplace Monitor to extract information from webpages in non-English languages.
This section currently accept the following values for Facebook Marketplace.
| Parameter | Required/Optional | Data Type | Description |
|---|---|---|---|
locale |
Required | String | locale of the translation |
Collection of Marketplace items |
Optional | String | The "arial-label" for search results. |
Condition |
Optional | String | Subtitle "condition" of an listing item. |
Description |
Optional | String | Title "description" for a rental item. |
Details |
Optional | String | Subtitle "Details" of an listing item. |
Location is approximate |
Optional | String | The word below listing location. |
About this vehicle |
Optional | String | The "About this vehicle" section of an automobile listing. |
Seller's description |
Optional | String | The "Seller's description" of an automobile listing. |
Note that not all words needs to be translated (the English version will be used if unspecified), and AI Marketplace Monitor may be able to extract information using language-independent methods.
Please see Support for non-English languages
Monitor Configuration
The optional monitor section allows you to define system configurations for the AI Marketplace Monitor. It supports options for sending your queries through one or more proxy servers, which can hide your IP address and reduce the chances of your IP being blocked.
| Option | Requirement | DataType | Description |
|---|---|---|---|
proxy_server |
Optional | String/List | URL for one or more proxy servers. |
proxy_bypass |
Optional | String | Comma-separated domains to bypass proxy. |
proxy_username |
Optional | String | username for the proxy. |
proxy_password |
Optional | String | password for the proxy. |
- If multiple
proxy_serverURLs are specified as a list, a random one will be chosen each time. However, the proxy will not change while the AI Marketplace Monitor is running.
Additional options
All sections, namely ai, marketplace, user, smtp, and region, accepts an option enabled, which, if set to false will disable the corresponding AI service,
marketplace, SMTP server, and stop notifying corresponding user. This option works like a comment statement that comments out the entire sections, which allowing the
sections to be referred from elsewhere (e.g. notify a disable user is allowed but notification will not be sent.)
| Parameter | Required/Optional | Data Type | Description |
|---|---|---|---|
enabled |
Optional | Boolean | Disable corresponding configuration if set to false. |