# NSE Kenya Market Data (`wafspaul/nse-kenya-market-data`) Actor

Scrapes live market data from the Nairobi Securities Exchange (nse.co.ke). Returns top gainers, losers, and most-traded stocks by volume. Updated in real time during trading hours.

- **URL**: https://apify.com/wafspaul/nse-kenya-market-data.md
- **Developed by:** [paul wafs](https://apify.com/wafspaul) (community)
- **Categories:** Integrations, News, Other
- **Stats:** 30 total users, 5 monthly users, 100.0% 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NSE Kenya Market Data

Live market movers from the Nairobi Securities Exchange (nse.co.ke) in one API call. This Actor returns the day's top gainers, top losers, and most-traded stocks by volume, updated in real time during NSE trading hours — no NSE data subscription, no manual checking.

### What you get

Each dataset item is one stock entry:

| Field | Description |
|---|---|
| category | gainer, loser, or mover |
| ticker | NSE stock symbol (e.g. SCOM, KPLC, EQTY) |
| price\_kes | Latest traded price in Kenyan Shillings |
| change\_pct | Percentage change with sign (e.g. +9.97, -3.15) |
| volume | Shares traded (for most-traded stocks) |
| source | Data source attribution (NSE Kenya) |
| source\_url | Source page |
| scraped\_at | ISO timestamp of collection |

Real sample output (JSON):

````json
{
  "category": "gainer",
    "ticker": "KPLC",
      "price_kes": 5.26,
        "change_pct": "+5.20",
          "source": "NSE Kenya",
            "source_url": "https://www.nse.co.ke/",
              "scraped_at": "2026-09-09T13:49:26.685Z"
              }
              ```

              ## How to use it

              1. Choose a Data Type: all (default), gainers, losers, or movers.
              2. Click Start. A run completes in a few minutes and returns the current top movers.
              3. Export as JSON/CSV/Excel, or connect to Google Sheets, Slack, Make, n8n, or Zapier.

              ### Input

              | Field | Type | Default | Options |
              |---|---|---|---|
              | dataType | string | all | all, gainers, losers, movers |

              Example input:
              ```json
              { "dataType": "gainers" }
              ```

              ## Use cases

              - Retail investors — a daily snapshot of NSE movers without logging into broker apps.
              - Fintech & investment apps — embed NSE market-mover data via the Apify API.
              - Analysts & researchers — build historical datasets of daily movers with scheduled runs.
              - Newsletters & Telegram/WhatsApp market updates — schedule a run at market close and auto-publish the day's movers.
              - AI agents & chatbots — give an assistant live awareness of the Kenyan market (see MCP below).

              ## Automate it

              Create a schedule in Apify Console (e.g. weekdays at 15:10 EAT, shortly after the NSE close) and pipe the dataset to Google Sheets or a messaging integration. Over time this builds a historical record of NSE daily movers — data that is otherwise hard to obtain for free.

              ## For AI agents (MCP)

              Call this Actor through the Apify MCP server (https://mcp.apify.com):

              Run wafspaul/nse-kenya-market-data with dataType 'gainers' and summarize today's top Kenyan stocks.

              Output is small, structured JSON (typically ~15 items) — ideal for direct use in agent conversations without flooding the context window.

              ## Pricing

              Free to use — you only pay for the Apify platform usage of each run (roughly $0.05–$0.10 per run at current compute rates).

              ## FAQ

              When is data live? During NSE trading hours (weekdays, 9:00–15:00 EAT). Outside trading hours the Actor returns the last session's figures.

              Is this official NSE data? Data is scraped from the publicly available pages of nse.co.ke. It is suitable for research and informational use; for regulated/commercial redistribution, consult NSE's data licensing.

              Not financial advice. This Actor provides market data only.

              Something broken? Report it in the Issues tab — fixes ship within 48 hours.

# Actor input Schema

## `dataType` (type: `string`):

Which market data to return.

## Actor input object example

```json
{
  "dataType": "all"
}
````

# 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("wafspaul/nse-kenya-market-data").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("wafspaul/nse-kenya-market-data").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 wafspaul/nse-kenya-market-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wafspaul/nse-kenya-market-data"
        }
    }
}

```

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/MTWjPBEIbPGNQSsmj/builds/qsdRsITVCXtGpce1N/openapi.json
