Predicting how search engine results pages (SERPs) will change over time can be a challenging task, especially when trying to account for the various factors that can impact a website’s ranking on a search engine. One tool that can help with this task is FBprophet, a popular open-source library for time series forecasting developed by Facebook. In this article, we will go over how to use FBprophet to make predictions about SERP changes over time and provide detailed examples of the code used.

What is FBprophet?

FBprophet is a time series forecasting library that is specifically designed for forecasting at scale. It was developed by Facebook and is used by the company to forecast the demand for various products and services. FBprophet is built on top of the popular Python data science library, Pandas, and uses a combination of linear models and a seasonality model to make predictions.

How to use FBprophet for SERP prediction

Before we can use FBprophet to make predictions about SERP changes, we first need to collect some data. For this example, we will use data on the ranking of a website for a particular keyword over time. This data can be obtained using a tool like SEMrush or Ahrefs.

Once we have collected our data, we can begin using FBprophet to make predictions. The first step is to import the necessary libraries and read in our data. In this case, we will need to import Pandas, NumPy, and FBprophet.

				
					import pandas as pd
import numpy as np
from fbprophet import Prophet
				
			

Next, we will use Pandas to read in our data and create a DataFrame. In this example, our data is in a CSV file called “serp_data.csv” and has two columns: “date” and “ranking”.

				
					df = pd.read_csv("serp_data.csv")
				
			

Once we have our data in a DataFrame, we can use FBprophet to make predictions. The first step is to initialise a new Prophet object and fit it to our data.

				
					m = Prophet()
m.fit(df)
				
			

After fitting our Prophet object to the data, we can use it to make predictions about SERP changes over time. To do this, we need to create a DataFrame with a column for the dates that we want to make predictions for. In this example, we will create a DataFrame with dates for the next 30 days.

				
					future = m.make_future_dataframe(periods=30)
				
			

Once we have our future DataFrame, we can use it to make predictions by calling the Prophet object’s predict method. This method will return a new DataFrame with the predicted rankings for each date.

				
					forecast = m.predict(future)
				
			

We can then use this DataFrame to plot the predictions and see how the rankings are expected to change over time. To do this, we will use the Prophet object’s plot method, which will generate a plot of the predictions.

				
					m.plot(forecast)

				
			

This plot will show the predicted rankings for each date, along with a prediction interval that indicates the range of possible values. The blue line represents the predicted ranking, and the shaded area represents the prediction interval.

Using FBprophet for SERP prediction with SEO

In addition to predicting SERP changes over time, FBprophet can also be used to make predictions about how SEO efforts will impact SERP rankings. This can be useful for understanding the potential benefits of implementing SEO strategies and for determining the best course of action for improving a website’s ranking on a search engine.

To make predictions about the impact of SEO on SERP rankings using FBprophet, we will need to collect data on the rankings of a website before and after implementing SEO efforts. This data can be obtained by tracking the rankings of a website over time and comparing the rankings before and after implementing SEO strategies.

Once we have collected this data, we can use FBprophet to make predictions in a similar way as we did before. We will need to create a DataFrame with the date and ranking for both the pre-SEO and post-SEO periods. We can then use FBprophet to fit a model to this data and make predictions about how the rankings will change over time.

 

				
					# create DataFrame with pre-SEO and post-SEO data
df = pd.DataFrame({"date": ["2020-01-01", "2020-01-02", "2020-01-03", "2020-01-04", "2020-01-05", "2020-01-06", "2020-01-07"],
                   "ranking": [10, 9, 8, 7, 6, 5, 4],
                   "period": ["pre-SEO", "pre-SEO", "pre-SEO", "pre-SEO", "pre-SEO", "post-SEO", "post-SEO"]})

# initialize Prophet object and fit to data
m = Prophet()
m.fit(df)

# create DataFrame with future dates
future = m.make_future_dataframe(periods=30)

# make predictions
forecast = m.predict(future)

# plot predictions
m.plot(forecast)

				
			

In this example, we can see that the predicted rankings for the post-SEO period are higher than the pre-SEO period, indicating that the SEO efforts have had a positive impact on the website’s ranking. This can help us understand the potential benefits of implementing SEO strategies and can guide our decision-making when it comes to improving a website’s ranking on a search engine.

Conclusion

FBprophet is a powerful tool for making predictions about SERP changes over time and the impact of SEO efforts on SERP rankings. By using this library, we can gain a better understanding a website’s ranking on a search engine is likely to change over time and make informed decisions about how to improve our ranking. 

Your Privacy Choices

By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

We won’t track your information when you visit our site. But in order to comply with your preferences, we’ll have to use just one tiny cookie so that you’re not asked to make this choice again.