How to send SERP API HTTPS requests

When targeting HTTPS, URLs data is encrypted. Therefore, in order for SERP API to decrypt the data and return the result, you will need to download and install the Bright Data Certificate or skip the SSL validation.

Here are explanations on how to send HTTPS requests:

Sending HTTPS requests without SSL validation

Use --insecure or -k flag

curl -v  --insecure --compressed --proxy --proxy-user brd-customer-<ACCOUNT_ID>-zone-<ZONE>:<PASSWORD> ""




Add the following argument to the JVM:


ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;


import ssl
ssl._create_default_https_context = ssl._create_unverified_context


Sending HTTPS requests with SSL validation

Use the --cacert flag followed by the certificate file path:

curl -v --compressed --cacert “{cert file path}“ --proxy --proxy-user brd-customer-{ACCOUNT_ID}-zone-{ZONE}:{PASSWORD} ""


Import the certificate to the Java Keystore.

Example using Java keytool to import the certificate:

%JAVA_HOME% Keystore (mostly the cacerts file in ..\lib\security\).

Keytool command example:

keytool -import -alias <cert alias> -file <cert name>.cer -keystore <keystore filename> -storepass <keystore password>

After running the keytool command you will be prompted if to trust the certificate: answer ‘y’ 

Other code Languages

Follow the instructions in the following article on how to download and Install the Bright Data certificate to your local machine's Trusted Root Certification Authorities.

Was this article helpful?