Description Usage Arguments Value Examples
Storywrangler's ngrams API lets you search a large historical database of Twitter data for daily usage statistics about strings of one, two, and three words (1-grams, 2-grams, and 3-grams respectively).
This function will query the API for a specific date to return the rank and frequency data for its top n ngrams. Please note that queries of over 1000 ngrams will take a long time to load.
For more details about Storywrangler, please see:
API documentation: https://github.com/janeadams/storywrangler
Academic paper describing uses: https://advances.sciencemag.org/content/7/29/eabe6534.full
1 |
date |
The date to query, in either character "YYYY-MM-DD" or Date format. |
max |
The maximum number of ngrams to return. Defaults to 100. |
language |
The two-letter code of the language to query. Defaults to "en". |
ngrams |
Integer specifying the type of n-grams to return. Accepts 1, 2, and 3, and defaults to 1. |
A tibble with the API query and response.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.