Documentation Index
Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt
Use this file to discover all available pages before exploring further.
Supported Lead Sources
| Source | Code path | Storage source value |
|---|---|---|
| IndiaMART CRM API | lead_fetcher.py poller | indiamart |
| Facebook Lead Ads | lead_fetcher.py webhook | facebook_ads |
| Facebook Page messages | lead_fetcher.py webhook | facebook_page |
| CSV upload | streamlit_app.py dashboard | facebook |
| Manual SQL | Direct insert | Any configured value |
IndiaMART
The poller calls:INDIAMART_NEW_ONLY_MODE=true, the code calls the API without explicit start/end timestamps after initialization, using IndiaMART’s new-lead cursor behavior.
Stored fields:
phonefromSENDER_MOBILEnamefromSENDER_NAMEemailfromSENDER_EMAILproduct_namefromQUERY_PRODUCT_NAMEcityfromSENDER_CITYstatefromSENDER_STATEquery_messagefromQUERY_MESSAGE
Facebook Webhooks
Webhook endpoint:GET endpoint handles Facebook verification. The POST endpoint handles events.
If FACEBOOK_APP_SECRET is configured, the app verifies X-Hub-Signature-256.
Facebook Lead Ads
When Facebook sends aleadgen event, the app fetches the lead via Graph API and stores:
phonenameemailsource='facebook_ads'
Facebook Page Messages
For Page messages, the app attempts to fetch the sender phone number through Graph API. If no phone is available, it stores:fb_psid_... values. It marks those leads failed because they do not contain a real phone number.
CSV Upload
The Streamlit dashboard supports CSV lead upload. Required columns:namephone
sourceemailproduct_namecitystatequery_message
_clean_source_value() function.