Skip to content

Proxy, network and location ​

Three options of the process shape how the virtual phone reaches Instagram and where it says it is: the proxy it connects through, the network it is presented on, and its coarse position. They are fields of the object an entry takes (install, and launch for the network and position of a new process).

ts
import { AndroidIgpapi } from '@igpapi/android';
import { Effect } from 'effect';

const username = process.env['IG_USERNAME'] ?? '';

// The options of the process are fields of the entry's object.
const first = await AndroidIgpapi.install({
  seed: username,
  // The proxy the phone connects through: `http://` and `socks5://` addresses.
  proxy: 'http://user:pass@host:8080',
  // A new phone is presented on a cellular LTE network; present it on Wi-Fi instead.
  network: { kind: 'wifi' },
  // The phone's coarse position, which the search results' Accounts request can carry.
  location: { lat: 11.111111, lng: 22.222222 },
  main: home => Effect.succeed(home.id),
});
console.log(first);

Proxy ​

proxy is the address of the proxy the phone connects through, with the user and password in the address when it needs them. The schemes it accepts are http:// and socks5://. Use one stable proxy per account (Account safety and pacing).

An http:// proxy cannot carry the UDP that HTTP/3 needs, so HTTP/3 does not get through behind one (Connection protocol).

Network ​

A new phone is presented on a cellular LTE network: the connection headers carry the values the Instagram app sends on LTE. To present the phone on Wi-Fi, pass network: { kind: 'wifi' }. A stored session keeps the network it was saved with; passing network to launch replaces it.

Location ​

The search results' Accounts request can carry the phone's coarse position. It is a fact of the phone, not an input of the request: a phone with a known position sends it, a phone without one sends nothing, and the search field's typeahead sends none either way. Pass location to a new phone to give it a position, or to launch to replace a stored one. The current app sends the position only on the search results' Accounts request.

The pages of this site are the README files of the repository. The API reference is generated from the source.