> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypersender.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WhatsApp Contacts and LIDs in Node.js

> Resolve WhatsApp LIDs to phone numbers and back from Node.js, list known LID mappings, and count them with the Hypersender WhatsApp API and its TypeScript SDK.

## Overview

Look up information about WhatsApp contacts. Contact methods live under `Hypersender.whatsapp().contacts`.

## LIDs

WhatsApp sometimes identifies contacts by a LID (linked identifier, e.g. `1111111@lid`) instead of their phone number. Use these methods to map between the two. [(learn more about LIDs)](https://docs.hypersender.com/v2/hypersender/overview/whatsapp/whatsapp-lid-issue.md)

### Get Phone Number by LID

Resolve a LID to the contact's phone-number chat ID. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/contacts/get-phone-number-by-lid.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> const mapping = await Hypersender.whatsapp().contacts.getPhoneNumberByLid("1111111@lid");
>
> // { lid: "1111111@lid", pn: "3333333@c.us" }
> console.log(mapping.pn);
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | lid | string | yes | The LID to resolve, e.g. `1111111@lid` or `1111111` (passed as the first argument) |

### Get LID by Phone Number

Find the LID linked to a phone number. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/contacts/get-lid-by-phone-number.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> const mapping = await Hypersender.whatsapp().contacts.getLidByPhoneNumber("3333333@c.us");
>
> // { lid: "1111111@lid", pn: "3333333@c.us" }
> console.log(mapping.lid);
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | phoneNumber | string | yes | The phone number to resolve, e.g. `3333333@c.us` or `3333333` (passed as the first argument) |

### Get All Known LIDs

List the LID to phone number mappings the instance knows about. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/contacts/get-all-known-lids.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> const mappings = await Hypersender.whatsapp().contacts.getAllKnownLids({
>   limit: 100,
>   offset: 0,
> });
>
> // [{ lid: "1111111@lid", pn: "3333333@c.us" }, ...]
> console.log(mappings.length);
> ```

> [tab] Parameters
>
> | Parameter | Type | Required | Description |
> | - | - | - | - |
> | limit | number | no | Maximum number of mappings to return (default: 100) |
> | offset | number | no | Number of mappings to skip (default: 0) |

### Get LIDs Count

Get how many LID mappings the instance knows about. [(learn more)](https://docs.hypersender.com/v2/api-reference/whatsapp/contacts/get-count-of-lids.md)

> [tab] Basic Usage
>
> ```typescript theme={null}
> import { Hypersender } from "hypersender-node";
>
> const { count } = await Hypersender.whatsapp().contacts.getLidsCount();
>
> console.log(count);
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.