Automate search engine optimization (SEO) tasks with MATLAB® to enhance your website's visibility and drive organic traffic.
This repository provides a solution for automating website ranking and keyword analysis using MATLAB®. By leveraging MATLAB's command-line interfaces with popular search engines, you can effortlessly:
- Retrieve information about your ranking in search results.
- Compute the SEO score of your webpage with well-known methods.
- Research your competitor's keywords with website crawling.
Evaluate the effectiveness of your website's SEO by using the Google Programmable Search Engine API key to check if your website appears in the top search results for a specific keyword.
googleEngine = googleapi.SearchEngine(); % class included in this repository
keyword = "matlab online"; % search word
websites = getTopSitesInBrowserSearch(keyword, googleEngine, 'maxSites', 10)
The above example demonstrates how to retrieve the top 10 search results from Google for the keyword "matlab online". By executing the code, you will obtain a list of websites that rank in the top search results. This information can provide valuable insights into your website's visibility and SEO performance.
Use the functions included in this repository to compute your website's SEO score for a specific keyword, using a variety of scoring methods.
website = "https://www.mathworks.com/";
keyword = "artificial intelligence";
score1 = getPageScoreForKeyword(website, keyword, method="KeywordDensity")
score2 = getPageScoreForKeyword(website, keyword, method="BacklinksFromTop10")
You can use ChatGPT as a scoring method. The tool uses MatGPT to connect MATLAB to the OpenAI API and ask ChatGPT for a SEO score.
score3 = getPageScoreForKeyword(website, keyword, method="ChatGPT")
Feel free to explore the repository and adapt the code to suit your specific needs.
To run the code in this repository, you need the following:
- MATLAB® release R2022b or newer.
- Google Programmable Search Engine API key
- Download the content of this repository.
- Launch MATLAB from your desktop or MATLAB Online from your browser.
- Before using, set an environment variable with your Google Custom Search Engine ID and API key.
setenv("GOOGLE_SEARCH_ENGINE_ID", "your-search-engine-id-here");
setenv("GOOGLE_SEARCH_ENGINE_API_KEY", "your-api-key-here");
- Open the project file WebsiteRanking.prj to setup the project.
- Open the examples/GoogleTop10.mlx Live Script for a short demo.
Contributions to this repository are welcome. If you have any ideas or improvements, feel free to submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.