'HTTP error 403 when using jsonlite fromJSON in RStudio

library(jsonlite)
url <- "https://api.nftport.xyz/v0/nfts"
data <- fromJSON(url)
a <- as.data.frame(data)

I am new to API, JSON, and R in general. Would like to ask how do I go about building a connection with the API, and retrieving the JSON format, and converting it into a dataframe that I can use.

Have been facing this error.

Error in open.connection(con, "rb") : HTTP error 403.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source