Advertools
raw JSON → 0.17.2 verified Mon Apr 27 auth: no python
Advertools is a Python library for digital marketing and SEO analysis, providing tools for keyword research, spider simulations, social media analysis, and more. Current version: 0.17.2, released irregularly.
pip install advertools Common errors
error ModuleNotFoundError: No module named 'advertools.ad_create' ↓
cause Incorrect import style: 'import advertools.ad_create' instead of 'from advertools import ad_create'.
fix
Use 'from advertools import ad_create'.
error ValueError: The truth value of a DataFrame is ambiguous ↓
cause Passing a pandas DataFrame directly to a function that expects a boolean or scalar.
fix
Extract scalar values or use .any()/.all() methods.
error requests.exceptions.HTTPError: 429 Client Error: Too Many Requests ↓
cause Rate limiting by Google when using spider or search functions.
fix
Increase delays or reduce request frequency. Use 'adv.spider' with 'max_requests_per_second' parameter.
Warnings
deprecated Function 'advertools.serp.googlesearch' is deprecated in v0.17.0. Use 'advertools.serp.serp_goog' instead. ↓
fix Replace serp.googlesearch with serp.serp_goog.
breaking In v0.15.0, the 'advertools.ad_create' function's 'headline' parameter was renamed to 'headlines' (plural). ↓
fix Update keyword argument from 'headline' to 'headlines'.
gotcha Google Trends functions require a working internet connection and may raise HTTPError if rate-limited. ↓
fix Add retries or use proxies. Set user-agent if needed.
Imports
- advertools wrong
from advertools import *correctimport advertools as adv - advertools.ad_create wrong
import advertools.ad_createcorrectfrom advertools import ad_create
Quickstart
import advertools as adv
# Generate keywords from a seed list
seed_words = ['shoes', 'boots']
keywords = adv.generate_google_keywords(seed_words)
print(keywords.head())