Skip to content

Instantly share code, notes, and snippets.

View MartijnSch's full-sized avatar
💭
Writing Code for Marketing & Growth Use Cases

Martijn Scheijbeler MartijnSch

💭
Writing Code for Marketing & Growth Use Cases
View GitHub Profile
import datetime
import requests
import csv
import json
import re
URL = "https://example.com"
API_KEY = ''
request_url = "https://ssl.bing.com/webmaster/api.svc/json/GetQueryStats?apikey={}&siteUrl={}".format(API_KEY, URL)
@MartijnSch
MartijnSch / google_search_console_ctr_curve.r
Last active November 12, 2020 14:24
R Script to Calculate CTR Curves with Google Search Console data
## A script to retrieve Google Search Console data for the last 90 days and plot a graph for CTR%
## It will retrieve the data from the Google Search Console API and make sure that it can be plotted for a visual graph
## Version 2: March 1, 2019
## Author: Martijn Scheijbeler (https://www.martijnscheijbeler.com)
## All credits go to Mark Edmondson for creating: https://github.com/MarkEdmondson1234/searchConsoleR & https://code.markedmondson.me/search-console-google-analytics-r-keyword-research/
## Load the required libraries: googleAuthR, searchConsoleR, dplyr, ggplot2
## (Download them with install.packages("googleAuthR"), install.packages("searchConsoleR"), install.packages("dplyr") and install.packages("ggplot2") if necessary