/get-cookies

The /get-cookies node is useful for retrieving the names of cookies set by a specified URL. This can be particularly helpful for debugging, monitoring, or analyzing web interactions and behaviors.

Method: POST

Request Body

  • url (string, required): The URL from which to retrieve the cookies. This should be a fully qualified URL (including http:// or https://).

Response

  • cookies (array): An array of cookie names set by the specified URL.
  • error (string): An error message if the request fails.

Endpoint URL:

https://node.nodetrigger.com/get-cookies

Request Method: POST

Content-Type: application/json

Request Example

{
  "url": "http://example.com"
}

Response Example

Success Response:

{
  "cookies": ["__utmvbDIupaFOZ", "another_cookie_name"]
}

Error Response:

{
  "error": "URL is required"
}
{
  "error": "Error fetching the URL with both proxies"
}

Making a Call

To use the /get-cookies endpoint, make a POST request to https://node.nodetrigger.com/get-cookies with a JSON body containing the url parameter.

cURL Example

curl -X POST https://node.nodetrigger.com/get-cookies \
     -H "Content-Type: application/json" \
     -d '{"url": "http://example.com"}'

Real-Life Examples

  1. Example 1: Retrieve cookies from a blog site Request:
   {
     "url": "http://myblogsite.com"
   }

Response:

   {
     "cookies": ["sessionid", "csrftoken"]
   }
  1. Example 2: Retrieve cookies from an e-commerce site Request:
   {
     "url": "https://myecommerce.com"
   }

Response:

   {
     "cookies": ["cart_id", "user_token", "recently_viewed"]
   }