Skip to content

Proxy, network, location and timezone ​

Four 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, its coarse position and its time zone. They are fields of the object an entry takes (install, and launch for the network, position and time zone 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 },
  // The phone's time zone: set it to the proxy's exit country's zone so the two agree.
  timezone: 'Asia/Makassar',
  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.

Timezone ​

timezone is the phone's time zone, as an IANA name (Asia/Makassar). It is a fact of the phone: the app reports the zone's name and its offset for the zone in the request headers and bodies that carry time, and the library derives the offset from the name. A phone's time zone that does not match the proxy's exit country is a signal the Instagram app never sends, so set timezone to the proxy's zone whenever you use a proxy. A new phone without timezone takes the host machine's zone, a stored session keeps the zone it was saved with, and passing timezone to launch replaces it. A resume takes none: the zone is in the checkpoint.

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