canonical: https://jentic.com/apis/ok.ru/ok

# Ok Ru Odnoklassniki (OK.ru) API

Odnoklassniki (OK.ru) is a major Russian-language social network. The REST API exposes 20 endpoints for reading user profiles, friends, group membership and metadata, and account flags. Use it to look up the current logged-in user, fetch profile data for a list of user IDs, list friends and friends-of-friends, and read group metadata for community-management or social-listening workflows.

## For AI agents

Read OK.ru user profiles, friends lists, and group metadata for social-listening and community-management workflows.

## Scope

Does not handle posting content, video upload, or ad campaigns through this surface - use for OK.ru user, friend, and group reads only.

## Capabilities

- Retrieve the currently logged-in user's profile and ID
- Fetch profile data for a batch of user IDs in one call
- List a user's friends and detect mutual connections
- Check whether a user has installed an app or granted a permission
- Read group metadata, membership, and category information
- Inspect account flags such as 'has password' or 'is blocked'

## Use cases

### Social login profile import

When a user signs in with OK.ru, fetch their profile via /api/users/getCurrentUser and getInfo to populate the local account record with display name, avatar, and verified-email flag. The API returns enough fields to skip the standard profile-completion step, reducing onboarding friction for Russian-speaking audiences.

Example prompt: After OAuth callback, call /api/users/getCurrentUser to retrieve the user's UID then /api/users/getInfo to fetch display name, gender, and locale

### Friend graph import for invitations

Apps with social features import a user's OK.ru friends list to suggest in-app connections or send invitations. The friends endpoints expose UIDs that can be cross-referenced against existing app users, and the user-info endpoint enriches the matches with display data.

Example prompt: Fetch the logged-in user's friend UIDs and resolve them to display names with /api/users/getInfo in batches

### Group community management

Community managers running OK.ru groups read group metadata to verify category, member count, and access settings, and confirm membership before posting moderation tools or analytics. The group endpoints provide a programmatic alternative to the OK.ru admin UI for routine checks.

Example prompt: Retrieve the metadata for an OK.ru group by its group_id and report category, type, and member count

### AI agent social profile lookup via Jentic

An AI agent answering 'who is this OK.ru user?' uses Jentic to call getInfoBy and resolve a profile URL or numeric UID into a structured profile record. The agent searches Jentic for the lookup intent, loads the schema, and executes through OAuth credentials managed in your Jentic One instance.

Example prompt: Search Jentic for 'OK.ru get user info', load the schema, and execute getInfoBy for a user-supplied profile reference

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /api/users/getCurrentUser | Get the current logged-in user's UID |
| GET | /api/users/getInfo | Fetch profile data for a list of UIDs |
| GET | /api/users/getInfoBy | Resolve a profile URL into a UID and profile data |
| GET | /api/users/isAppUser | Check whether a UID has installed the app |
| GET | /api/users/hasAppPermission | Check whether a UID has granted a specific app permission |
| GET | /api/users/checkFlag | Check an account flag value |

## Key resources

- **Users** — Profile lookups, current user, app-user checks, and account flags
- **Friends** — Friend list and mutual-friend operations
- **Groups** — Group metadata, category, and membership reads

## Why Jentic

- **Setup:** Wiring the Odnoklassniki (OK.ru) API by hand means running its OAuth authorization-code flow, refreshing per-user tokens, and navigating 20 read endpoints across users, friends, and groups yourself. Through Jentic you install once, import OK.ru from the API Directory, store the client credentials once, and your agent calls it.
- **Permission scoping:** The OK.ru read endpoints carry their targets in query parameters rather than the URL path, so scoping is by operation: you limit the agent to the operations it needs, such as getting the current user or reading group info, and it can call nothing else. You choose which of those reads are in the allowed set.
- **Credential handling:** Your OK.ru OAuth client credentials and per-user tokens are stored once, encrypted, by your own Jentic One instance, which mints and refreshes tokens and injects them at execution time. The client secret never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get OK.ru group info' or 'look up a user', and Jentic returns the matching operation with its parameters typed in the input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **VK API** — Russia's other major social network with a similar profile, friend, and group API surface
- **Facebook Graph API** — Western social graph alternative when the audience is global rather than CIS-region
- **Instagram Graph API** — Pair OK.ru community management with Instagram for a multi-platform social presence

## FAQ

### What authentication does the OK.ru API use?

The API uses OAuth 2.0. Apps register on apiok.ru, redirect users through the OAuth flow, and call endpoints with the resulting access token. Through Jentic, OAuth client credentials are stored encrypted in the vault and tokens are refreshed automatically, so the raw client secret never enters the agent's context.

### Can I look up a user's profile with the OK.ru API?

Yes. /api/users/getCurrentUser returns the logged-in user's UID, /api/users/getInfo accepts a list of UIDs and returns profile fields, and /api/users/getInfoBy resolves a profile URL into a UID first. Choose the endpoint that matches the input form you have.

### What are the rate limits for the OK.ru API?

OK.ru applies per-app and per-user rate limits that vary by app tier. Limits are not exposed in the spec but are documented on apiok.ru. Treat 429 and 'too many requests' responses as a backoff signal and batch UID lookups (getInfo accepts arrays) to reduce call volume.

### How do I get the current user's friends through Jentic?

Search Jentic for 'OK.ru friends list', load the schema for the friends operation, and execute with the access token bound to the logged-in user. The response contains UIDs, which you can then resolve via /api/users/getInfo for display names.

### Can I check whether a user has installed my OK.ru app?

Yes. /api/users/isAppUser returns whether a UID has installed the calling app, and /api/users/hasAppPermission checks specific permissions like photo or messaging. These are useful before calling endpoints that require app-user consent.

### Can I limit what my agent is allowed to do with the OK.ru API?

Yes. Because the OK.ru read endpoints carry their targets in query parameters rather than the URL path, Jentic One scopes access by operation, and since you self-host it your own rules decide which of the 20 reads the agent may call. You can allow just getCurrentUser and getInfo for a profile-lookup agent, add the friends and group-metadata reads for a community-management agent, and the agent can call nothing outside that allowed set. Your OAuth client credentials stay in your Jentic One instance and are injected at execution time, so the agent never sees the client secret.
