Giter Club home page Giter Club logo

seo-keyword-research-tool's Introduction

SEO Keyword Research Tool 🔎

Python SEO keywords suggestion tool that pulls data from Google Autocomplete, People Also Ask and Related Searches.

SerpApi

Downloads licence

This tool uses SerpApi as a tool to parse data from Google search results.

You can use provided API key that will be available after installation, however, it's purely for testing purposes to see if the tool fits your needs. If you'll be using it for your own purpose (personal or commercial), you have to use your own SerpApi key.

⚙️Installation

$ pip install seo-keyword-research-tool

🤹‍♂️Usage

seo-keywords-research-tool-example-usage

Available CLI arugments:

$ seo -h
SerpApi SEO Keyword Research Tool [-h] -q  [-e  [...]] [-dl] [-st] [-ak] [-gd] [-gl] [-hl]

Extract keywrods from: Google Autocomplete, People Also Ask, and People Also Search and saves data to CSV/JSON/TXT.

optional arguments:
  -h, --help            show this help message and exit
  -q , --query          Search query (required).
  -e  [ ...], --engines  [ ...]
                        Choices of engines to extract: Autocomplete (ac), Related Searches (rs), People Also Ask (rq). You can select multiple engines. All engines are selected by default.
  -dl , --depth-limit   Depth limit for People Also Ask. Default is 0, first 2-4 results.
  -st , --save-to       Saves the results in the current directory in the selected format (CSV, JSON, TXT). Default CSV.
  -ak , --api-key       Your SerpApi API key: https://serpapi.com/manage-api-key. Default is a test API key to test CLI.
  -gd , --domain        Google domain: https://serpapi.com/google-domains. Default google.com.
  -gl , --country       Country of the search: https://serpapi.com/google-countries. Default us.
  -hl , --lang          Language of the search: https://serpapi.com/google-languages. Default en.

Found a bug? Open issue: https://github.com/chukhraiartur/seo-keyword-research-tool/issues

The --depth-limit argument for People Also Ask can be set from 0 to 4. For each depth limit value, the number of results returned grows exponentially. Below is a table showing how the depth limit argument is affected:

Depth limit Number of results Explanation
0 4 Standard results
1 12 4*2 = 8 + 4 = 12
2 36 8*3 = 24 + 12 = 36
3 108 24*3 = 72 + 36 = 108
4 324 72*3 = 216 + 108 = 324

📌Note: This is how the logic works for the google.com domain, on other domains the results may differ.

Simple example:

$ seo -q "starbucks coffee"
{
  "auto_complete": [
    "starbucks coffee menu",
    "starbucks coffee cups",
    "starbucks coffee sizes",
    "starbucks coffee mugs",
    "starbucks coffee gear",
    "starbucks coffee beans",
    "starbucks coffee near me",
    "starbucks coffee traveler"
  ],
  "related_searches": [
    "starbucks near me",
    "starbucks coffee price",
    "starbucks coffee beans",
    "starbucks company",
    "starbucks coffee menu",
    "starbucks merchandise",
    "starbucks coffee bags"
  ],
  "related_questions": [
    "What is the most popular Starbucks coffee?",
    "What is the number 1 Starbucks drink?",
    "What is the Tiktok coffee from Starbucks?",
    "Why is Starbucks coffee so famous?"
  ]
}

Advanced example:

This example will use related questions API engine with a depth limit value of 2, and saves data to JSON:

$ seo --api-key "<your_serpapi_api_key>" \
> -q "starbucks coffee" \
> -e rq \
> -dl 2 \
> -gd google.co.uk \
> -gl uk \
> -hl en \
> -st json \
{
  "related_questions": [
    "What is the best coffee in Starbucks?",
    "What is a popular Starbucks coffee?",
    "What is the number 1 Starbucks drink?",
    "Is Starbucks expensive?",
    "What should I try at Starbucks for the first time?",
    "Which Starbucks coffee is best and sweet?",
    "What is famous in Starbucks in India?",
    "Which Starbucks drink is the best in India?",
    "Why is Starbucks famous?",
    "What should I order in Starbucks?",
    "What is the least bitter coffee at Starbucks?",
    "What's the creamiest coffee?",
    "Which Starbucks coffee is best in taste?",
    "Which Starbucks coffee is best and sweet?",
    "Which Starbucks coffee is best in India?",
    "Which Starbucks coffee is best for first time?",
    "Why is Starbucks famous?",
    "What should I order at Starbucks for the first time?",
    "What is the best Starbucks drink for a first time coffee drinker?",
    "What should I order in Starbucks?",
    "What should I try at Starbucks for the first time?",
    "What is the most famous Starbucks drink?",
    "Which Starbucks coffee is best in taste?",
    "What coffee orders for beginners?",
    "What is the best thing to get at Starbucks?",
    "Which Starbucks drink is best?",
    "Which coffee is best in Starbucks India?",
    "Which Starbucks coffee is best in taste?",
    "Is Dunkin or Starbucks better?",
    "What are the negatives of Starbucks?",
    "Who has stronger coffee Starbucks or Dunkin?",
    "Why do people prefer Starbucks?",
    "Why is Starbucks so much better than Dunkin?",
    "Is Starbucks coffee high quality?",
    "Why is Starbucks coffee so good?",
    "Do Starbucks employees get free food?"
  ]
}

Example of manual data extraction (without CLI):

from SeoKeywordResearch import SeoKeywordResearch

keyword_research = SeoKeywordResearch(
    query='starbucks coffee',
    api_key='<your_serpapi_api_key>',
    lang='en',
    country='us',
    domain='google.com'
)

auto_complete_results = keyword_research.get_auto_complete()
related_searches_results = keyword_research.get_related_searches()
related_questions_results = keyword_research.get_related_questions()

data = {
    'auto_complete': auto_complete_results,
    'related_searches': related_searches_results,
    'related_questions': related_questions_results
}

keyword_research.save_to_json(data)
keyword_research.print_data(data)

✍Contributing

Feel free to open bug issue, something isn't working, what feature to add, or anything else related to Google autocomplete, related searches or people also ask.

seo-keyword-research-tool's People

Contributors

chukhraiartur avatar dimitryzub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

seo-keyword-research-tool's Issues

Import Error

from SeoKeywordResearch import SeoKeywordResearch
ModuleNotFoundError: No module named 'SeoKeywordResearch'
it give the above error when I try to run the code that you given in the example.py

Got an error on Depth-limit for detailed results

Hi @dimitryzub ,

I am trying this API to get detailed results but got an error on the depth limit parameter. can you help me to extract detailed results. and can we also get the statistics of these google searches e.g. number of times the terms/questions searches ??

CODE

keyword_research = SeoKeywordResearch(
query='moderna covid vaccine',
api_key=,
lang='en',
country='au',
depth_limit=2,
domain='google.com.au'
)

ERROR:
TypeError: SeoKeywordResearch.init() got an unexpected keyword argument 'depth_limit'

Arabic Search keywords issue

Hello,

Iam trying to run the following query:

seo -q اخبار السعودية -e rq -dl 1 -gl sa -hl ar -ak XXX

I got the following error:

Traceback (most recent call last):
File "/usr/local/bin/seo", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/SeoKeywordResearch/cli.py", line 19, in main
args = parser.parse_args()
File "/usr/lib/python3.10/argparse.py", line 1848, in parse_args
self.error(msg % ' '.join(argv))
File "/usr/lib/python3.10/argparse.py", line 2604, in error
self.print_usage(_sys.stderr)
File "/usr/lib/python3.10/argparse.py", line 2574, in print_usage
self._print_message(self.format_usage(), file)
File "/usr/lib/python3.10/argparse.py", line 2540, in format_usage
return formatter.format_help()
File "/usr/lib/python3.10/argparse.py", line 295, in format_help
help = self._root_section.format_help()
File "/usr/lib/python3.10/argparse.py", line 226, in format_help
item_help = join([func(*args) for func, args in self.items])
File "/usr/lib/python3.10/argparse.py", line 226, in
item_help = join([func(*args) for func, args in self.items])
File "/usr/lib/python3.10/argparse.py", line 350, in _format_usage
assert ' '.join(opt_parts) == opt_usage
AssertionError

[Feature request] Documentation for the programmatic API

Currently, only CLI usage is documented in the README and demo.

get_auto_complete, get_related_searches, and get_related_questions can be imported but it's not documented in the README. For example, a web app can be build with the same functionality as the CLI.

if 'all' in args.engines:
data['auto_complete'] = get_auto_complete(args.query, args.country, args.lang, args.api_key)
data['related_searches'] = get_related_searches(args.query, args.domain, args.country, args.lang, args.api_key)
data['related_questions'] = get_related_questions(args.query, args.domain, args.country, args.lang, args.api_key, args.depth_limit)

Wdyt?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.