Login Session avatar

Login Session

Try for free

No credit card required

View all Actors
Login Session

Login Session

pocesar/login-session
Try for free

No credit card required

Get localStorage, sessionStorage and cookies from logins for usage in other actors.

You can access the Login Session programmatically from your own applications by using the Apify API. You can choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.

1# Set API token
2API_TOKEN=<YOUR_API_TOKEN>
3
4# Prepare Actor input
5cat > input.json << 'EOF'
6{
7  "userAgent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36",
8  "maxRequestRetries": 0,
9  "sessionConfig": {
10    "storageName": "login-sessions",
11    "maxAgeSecs": 3600,
12    "maxUsageCount": 100,
13    "maxPoolSize": 100
14  },
15  "steps": [
16    {
17      "username": {
18        "selector": "input#email"
19      },
20      "password": {
21        "selector": "input#pass"
22      },
23      "submit": {
24        "selector": "input[type=\"submit\"]"
25      },
26      "failed": {
27        "selector": "[role=\"alert\"]"
28      },
29      "waitForMillis": 5000
30    }
31  ],
32  "cookieDomains": [],
33  "gotoTimeout": 30,
34  "proxyConfiguration": {
35    "useApifyProxy": true
36  },
37  "extraUrlPatterns": []
38}
39EOF
40
41# Run the Actor using an HTTP API
42# See the full API reference at https://docs.apify.com/api/v2
43curl "https://api.apify.com/v2/acts/pocesar~login-session/runs?token=$API_TOKEN" \
44  -X POST \
45  -d @input.json \
46  -H 'Content-Type: application/json'

Login Session API

Below, you can find a list of relevant HTTP API endpoints for calling the Login Session Actor. For this, you’ll need an Apify account. Replace <YOUR_API_TOKEN> in the URLs with your Apify API token, which you can find under Integrations in Apify Console. For details, see the API reference .

Run Actor

POST
https://api.apify.com/v2/acts/pocesar~login-session/runs?token=<YOUR_API_TOKEN>

Note: By adding the method=POST query parameter, this API endpoint can be called using a GET request and thus used in third-party webhooks. Please refer to our Run Actor API documentation .

Run Actor synchronously and get dataset items

POST
https://api.apify.com/v2/acts/pocesar~login-session/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>

Note: This endpoint supports both POST and GET request methods. However, only the POST method allows you to pass input data. For more information, please refer to our Run Actor synchronously and get dataset items API documentation .

Get Actor

GET
https://api.apify.com/v2/acts/pocesar~login-session?token=<YOUR_API_TOKEN>

For more information, please refer to our Get Actor API documentation .

Actors can be used to scrape web pages, extract data, or automate browser tasks. Use the Login Session API programmatically via the Apify API.

You can choose from:

You can start Login Session with the Apify API by sending an HTTP POST request to the Run Actor endpoint. An Actor’s input and its content type can be passed as a payload of the POST request, and additional options can be specified using URL query parameters. The Login Session is identified within the API by its ID, which is the creator’s username and the name of the Actor.

When the Login Session run finishes you can list the data from its default dataset (storage) via the API or you can preview the data directly on Apify Console .

Developer
Maintained by Community
Actor metrics
  • 8 monthly users
  • 6 stars
  • 16.0% runs succeeded
  • Created in Feb 2020
  • Modified over 3 years ago
Categories