Quickstart
This guide will get you all set up and ready to use the GoLogin API. We'll cover how to get started using one of our API clients and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful REST API.
Before you can make requests to the GoLogin API, you will need to grab your API key from your dashboard. You find it under Settings » API.
Making your first anonymous scrapping request
iphey.com
Check trustworthiness statusimport { GologinApi } from 'gologin';
const token = process.env.GL_API_TOKEN;
const gologin = GologinApi({ token });
async function main() {
const { browser } = await gologin.launch();
const page = await browser.newPage();
await page.goto('https://iphey.com/', { waitUntil: 'networkidle2' });
const status = await page.$eval('.trustworthy-status:not(.hide)',
(elt) => elt?.innerText?.trim()
);
return status; // Expecting 'Trustworthy'
}
main().catch(console.error).
then(console.info).finally(gologin.exit);
What this script does, step by step
- Create GoLogin API instance
- On the first run, downloads Orbita anti-detect web browser
- Create new anti-detect browser profile called default-api-profile
- Launch the web browser using the profile created
- Connect nodejs puppeteer library to the browser
- Navigates to the iphey.com page
- Scrapes trustworthiness status from the web page
- Print the status, which is expected to be 'Trustworthy'
Running code yourself
github.com
Run scrapping examplegit clone [email protected]:gologinapp/gologin.git
cd gologin
npm install
GL_API_TOKEN=[YOUR_GOLOGIN_API_TOKEN] node examples/example-iphey.js
What's next?
Great, you're now set up with an API client and have made your first request to the API. Here are a few links that might be handy as you venture further into the GoLogin API: