Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dimitryzub/142f3c0f0af752fa475a575d9f68bef4 to your computer and use it in GitHub Desktop.
Save dimitryzub/142f3c0f0af752fa475a575d9f68bef4 to your computer and use it in GitHub Desktop.
Scrape Google Scholar Cite Results with SerpApi
from serpapi import GoogleSearch
import os
params = {
"api_key": os.getenv("API_KEY"),
"engine": "google_scholar_cite",
"q": "FDc6HiktlqEJ"
}
search = GoogleSearch(params)
results = search.get_dict()
for cite in results['citations']:
print(f'Title: {cite["title"]}\nSnippet: {cite["snippet"]}\n')
# Output:
'''
Title: MLA
Snippet: Schwertmann, U. T. R. M., and Reginald M. Taylor. "Iron oxides." Minerals in soil environments 1 (1989): 379-438.
Title: APA
Snippet: Schwertmann, U. T. R. M., & Taylor, R. M. (1989). Iron oxides. Minerals in soil environments, 1, 379-438.
Title: Chicago
Snippet: Schwertmann, U. T. R. M., and Reginald M. Taylor. "Iron oxides." Minerals in soil environments 1 (1989): 379-438.
Title: Harvard
Snippet: Schwertmann, U.T.R.M. and Taylor, R.M., 1989. Iron oxides. Minerals in soil environments, 1, pp.379-438.
Title: Vancouver
Snippet: Schwertmann UT, Taylor RM. Iron oxides. Minerals in soil environments. 1989 Jan 1;1:379-438.
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment