Created
August 19, 2022 13:54
-
-
Save MattSandy/14242b5af9dce69102647e2000848bcc to your computer and use it in GitHub Desktop.
Inc. 5000 2022
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(jsonlite) | |
df <- "https://api.inc.com/rest/i5list/2022" %>% | |
fromJSON() %>% | |
.$companies %>% | |
bind_rows() %>% | |
group_by(inc5000companyId) %>% | |
mutate( | |
article = ifelse(is.null(article %>% unlist %>% .[1]),NA,article %>% unlist %>% .[1]), | |
editorsPick = editorsPick %>% unlist %>% paste(collapse = ",") | |
) %>% | |
write_csv("inc.csv") |
Hi Matt,
I figured to extract the company profile from "https://api.inc.com/rest/companyprofile/blockfi" but I'm able to extract the profile of only one company at a time and finding difficulty saving it in .cvs
Any possibility to list out all the 5000 profiles? please help.
library(tidyverse)
library(jsonlite)
df <- "https://api.inc.com/rest/companyprofile/blockfi" %>%
- fromJSON() %>%
- .$profile %>%
- bind_rows() %>%
- group_by(inc5000companyId) %>%
- mutate(
-
article = ifelse(is.null(article %>% unlist %>% .[1]),NA,article %>% unlist %>% .[1]),
-
editorsPick = editorsPick %>% unlist %>% paste(collapse = ",")
- ) %>%
- write_csv("profiles.csv")
Error inmutate()
:
! Problem while computingarticle = ifelse(...)
.
ℹ The error occurred in group 1: inc5000companyId = "130719".
Caused by error inunlist()
:
! object 'article' not found
Runrlang::last_error()
to see where the error occurred.
I came this far with 0 subject in R
Hey Syamjordan
Did you ever figure it out?
Hi Matt, if I want to rerun the list for 2023 is it as simple as changing the URL in the code above to "https://www.inc.com/inc5000/2023"?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot Matt! Thanks a lot!! God Bless You! it worked!

how can I also extract the 'leadership' data of those companies? please help. Sorry to bother you. Its a request. I'm looking for the the data of Inc5000 companies as shown in the attachment. Thank you.