# Screener.in (email login) (`talismatic_tequila/screener-in-custom`) Actor

Logs into Screener.in with email + password and extracts company details (getstockdetails) or runs screens (runQuery).

- **URL**: https://apify.com/talismatic_tequila/screener-in-custom.md
- **Developed by:** [Aditya Rokhade](https://apify.com/talismatic_tequila) (community)
- **Stats:** 4 total users, 4 monthly users, 99.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Screener.in custom Apify actor

A drop-in replacement for the third-party `shashwattrivedi~screener-in` actor,
which broke when Screener.in moved to **email-based login**. This actor logs in
with your registered email + password and exposes the same two modes with the
same input/output contract.

### Why the old actor broke

Screener.in migrated accounts to email login. The login form still posts a field
named `username`, but it now expects your **registered email** (e.g.
`sacbhar@gmail.com`), not a legacy handle. The old actor was sending the wrong
credential, so logins failed.

### Modes

#### `getstockdetails` (no login required)

```json
{ "mode": "getstockdetails", "url": "https://www.screener.in/company/RELIANCE/" }
```

Returns:

```jsonc
{
  "url": "...",
  "name": "Reliance Industries Ltd",
  "shareholding": { "quarterly": [ { "": "FIIs", "Jun 2026": 17.19, ... } ], "yearly": [...] },
  "ratios": { "Market Cap": "₹ 15,80,194 Cr.", "Current Price": "₹ 1,168", ... },
  "metrics": { "Name": "...", "CMP": "...", "Mar Cap": "...", "FII Hold": 17.19, "DII Hold": 21.1, "No of Share Holders": 4651863, ... }
}
```

#### `runQuery` (requires login)

```json
{
  "mode": "runQuery",
  "queryString": "Market Capitalization > 50000 AND Price to Earning < 20",
  "username": "your_email@example.com",
  "password": "your_password"
}
```

Returns an array of company rows. Each row has Screener's own column headers
**plus** short aliases matching the old actor: `Name`, `CMP`, `Mar Cap`, `ROCE`,
`ROCE 10Yr`, `Debt / Eq`, `Pledged`, `Prom Hold`, `Profit Prev 12M`,
`Profit growth`.

> The exact column set returned by `runQuery` is whatever your logged-in
> account's saved screen is configured to show. The account used here already
> has the needed columns configured.

### How login works (implementation detail)

Each run logs in fresh — no token caching:

1. `GET /login/` → capture the `csrftoken` cookie and the `csrfmiddlewaretoken`
   hidden input from the HTML.
2. `POST /login/` with `Referer: https://www.screener.in/login/`, the CSRF
   cookie, and body `csrfmiddlewaretoken`, `next=`, `username=<email>`,
   `password=<password>`.
3. Server sets a `sessionid` cookie — that is what authenticates subsequent
   requests. Screen results are read via `GET /screen/raw/?query=...&page=N`.

The CSRF token is not tied to the login session and is never reused between runs.

### Local test (no Apify runtime)

```bash
cd apify-screener
npm install
node test-local.mjs                                   # defaults to RELIANCE
node test-local.mjs https://www.screener.in/company/TCS/
```

### Deploy to Apify

```bash
npm install -g apify-cli      # if you don't have it
apify login                   # paste your Apify API token
cd apify-screener
apify push                    # builds the Docker image and uploads the actor
```

After `apify push`, note the actor ID shown (format: `<your_username>~screener-in-custom`),
then set it in the project `config.js`:

```js
APIFY_ACTOR_ID: 'your_username~screener-in-custom',
```

`screener.js` needs no other changes — it already sends `username`
(`SCREENER_USERNAME`, your email) and `password` for `runQuery`, and `url` for
`getstockdetails`.

### Security note

`../config.js` currently stores the Screener password and Apify tokens in
plaintext. Prefer passing them via Apify's secret inputs (the input schema marks
`username`/`password` as secret) or environment variables, and avoid committing
real credentials to source control.

# Actor input Schema

## `mode` (type: `string`):

What the actor should do.

## `url` (type: `string`):

For getstockdetails mode. e.g. https://www.screener.in/company/RELIANCE/

## `queryString` (type: `string`):

For runQuery mode. e.g. Market Capitalization > 50000 AND Price to Earning < 20

## `sessionid` (type: `string`):

For runQuery mode. An existing Screener.in sessionid cookie. When set, the actor skips login and username/password are ignored.

## `username` (type: `string`):

Registered email on Screener.in. Used for runQuery mode when no sessionid is given.

## `password` (type: `string`):

Screener.in password. Used for runQuery mode when no sessionid is given.

## Actor input object example

```json
{
  "mode": "getstockdetails"
}
```

# Actor output Schema

## `results` (type: `string`):

The dataset items pushed by the run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("talismatic_tequila/screener-in-custom").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("talismatic_tequila/screener-in-custom").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call talismatic_tequila/screener-in-custom --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,talismatic_tequila/screener-in-custom"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/GJomjdHQZydZ9xkce/builds/K67TxETGt0k1Tj3F2/openapi.json
