Logging Into another website through node

I’m learning API so I apologize if the question might be stupid for some but I need to clear up my mind about the possibilities API gives me. Assuming I do know the credential of an account on that website, can I make a script that logs into this other website by passing my data and just iterates and returns me the informations I require? Or the only way to do that is throughout an API of that website?

Sure you can, it’s just a faff to implement, and larger websites will have measures in place to block you if you’re detected doing it. If the site has an API, use the API, logins and webpages are designed for people, not computers. If you can get the same data you want from the API, use the API.

As an aside, if you can’t get the data via API and you definitely need to scrape the website, Python has generally better tools for it than almost any other language.