Set Screen from API

  • Created

In this article we are going to show you how to change the profiles Screen Resolution during the creation of your virtual browser profile through the Local API Clients.

To learn more about Screen Resolution spoofing and how Kameleo is spoofing it in order to let you bypass anti-bot systems during your web-scraping or browser automation projects please read the following articles:

Concept

During the CreateProfileRequest

POST /profiles/new

you can pass the CreateProfileRequest object that has a ScreenSpoofingType property. This can be used to set up Screen spoofing, as the possible values are:

  • Automatic: Use the Screen Resolution from the fingerprint for consistent spoofing.
  • Manual: Set a custom Screen Resolution to customize the browser profile.
  • Off: Use your device's unmasked Screen Resolution for a genuine browsing experience.

We suggest you to use the "Automatic" setting that is included in the set recommended defaults call. To set the Screen Resolution spoofing type, use the setScreenmethod in the Local API Clients. Below you can find the examples for Javascript and Python:

Examples

  • const createProfileRequest = BuilderForCreateProfile
      .forBaseProfile(chromeBaseProfileList[0].id)
      .setRecommendedDefaults()
      .setScreen('manual', '800x600') \  # Options: ('automatic', 'manual', 'off') # In this example we used the value of "800x600"
      .build();
    const profile = await client.createProfile({ body: createProfileRequest });
  • create_profile_request = BuilderForCreateProfile \
      .for_base_profile(base_profiles[0].id) \
      .set_recommended_defaults() \
      .set_screen('manual', '800x600') \  # Options: ('automatic', 'manual', 'off') # In this example we used the value of "800x600"
      .build()
    profile = client.create_profile(body=create_profile_request)

For your convenience, this functionality is provided by the Python Builder and JavaScript Builder for Profile Creation in the Local API Clients.

Was this article helpful?

0 out of 0 found this helpful