# 🇱🇰 Sri Lanka CSE — Colombo Stock Exchange Data (`nexgendata/sri-lanka-cse-market-data`) Actor

Colombo Stock Exchange (Sri Lanka) market data: today's share prices, top gainers/losers, and company announcements. For frontier/emerging-market investors and index providers.

- **URL**: https://apify.com/nexgendata/sri-lanka-cse-market-data.md
- **Developed by:** [NexGenData](https://apify.com/nexgendata) (community)
- **Categories:** Business
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 datasets

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## 🇱🇰 Sri Lanka CSE — Colombo Stock Exchange Data

**Pull live Colombo Stock Exchange market data — today's share prices, top gainers and losers, and company announcements — as pay-per-result JSON, $0.10 per record. No Bloomberg seat, no FactSet contract, no frontier-market data wall.**

The Colombo Stock Exchange (CSE) is Sri Lanka's primary equity market, and frontier-market investors, index providers, and country-fund managers who want exposure to it run straight into a data problem: the major global terminals charge tens of thousands of dollars a year and still treat a single frontier exchange as a long-tail afterthought, while the free CSE web pages are a manual, one-screen-at-a-time experience that can't be polled or piped into a model. This actor turns the CSE's public market pages into a clean, structured, machine-readable feed. Point it at today's share prices, the day's top gainers and losers, or the company-announcement stream, and it returns each row as JSON ready to drop into your warehouse, your index-construction pipeline, or your research notebook.

### Why use this

Frontier-market equity data is the most expensive coverage-per-dollar you can buy. Bloomberg and FactSet will sell you Colombo Stock Exchange data — bundled inside a ~$12,000–$24,000 / seat / year terminal whose value is overwhelmingly in markets you may not care about, behind a per-seat login you cannot pipe into your own model. The CSE itself publishes today's prices and movers on public web pages, but those pages are built for a human clicking through them, not for a daily ETL job.

This actor closes that gap. A single `mode` parameter selects which public CSE dataset you want — today's prices, the gainers/losers board, or company announcements — and the actor returns it as structured rows you can schedule, diff, and join. For a frontier allocator who needs Sri Lanka coverage and nothing else, paying per record beats renting a global terminal by orders of magnitude.

### What you get

When pulling share-price data, each record is structured JSON carrying the per-symbol quote fields below, populated wherever the CSE source provides them:

- `symbol` — the CSE ticker symbol for the listed security
- `lastTradedPrice` — the most recent traded price for the session
- `open` — the session opening price
- `high` — the session intraday high
- `low` — the session intraday low

The schema is stable across runs, so you can append straight to Snowflake, BigQuery, Postgres, or a research database without re-mapping each refresh.

### Use cases

- **Frontier-market portfolio monitoring** — Pull today's CSE prices on a daily schedule and append to a time-series table keyed on `symbol` + date to maintain your own Sri Lanka price history without a terminal subscription.
- **Index construction and tracking** — Index and ETF providers covering frontier markets need a clean daily price feed to compute and rebalance a Sri Lanka sleeve; the per-symbol `lastTradedPrice` is the input.
- **Daily movers screening** — Use the gainers/losers mode to surface the day's biggest CSE moves for momentum, mean-reversion, or news-driven research.
- **Corporate-event monitoring** — Use the announcements mode to track CSE-listed company disclosures (dividends, results, board changes) for event-driven and governance research.
- **Intraday range and volatility studies** — The `open`, `high`, and `low` fields let you compute true range and realized-volatility proxies per symbol without a tick feed.
- **Country-fund and EM research** — Country-fund managers and emerging/frontier-market desks fold Sri Lanka prices into cross-market relative-value and allocation models.
- **Backtesting and academic research** — Build a clean daily CSE dataset over time for factor and event studies on a market that's poorly served by mainstream vendors.

### Sample output

```json
{
  "symbol": "JKH.N0000",
  "lastTradedPrice": 198.50,
  "open": 196.00,
  "high": 199.75,
  "low": 195.25
}
````

### Input parameters

| Parameter | Label | Description |
| --- | --- | --- |
| `mode` | Mode | Which CSE dataset to fetch — today's share prices, top gainers/losers, or company announcements. |
| `maxResults` | Max results | Maximum number of records to return. |

### How to use

#### Python (apify-client)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")

run = client.actor("nexgendata/sri-lanka-cse-market-data").call(run_input={
    "mode": "prices",
    "maxResults": 500,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["symbol"], item["lastTradedPrice"], item["high"], item["low"])
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/nexgendata~sri-lanka-cse-market-data/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "prices",
    "maxResults": 500
  }'
```

Schedule it at the CSE session close via Apify's built-in scheduler and append each pull, keyed on `symbol` + date, to build your own price history. Wire a webhook to push the gainers/losers or announcements feed into Slack or n8n for a daily market brief.

### Pricing

This actor runs on Apify's **pay-per-event (PPE)** model — you pay only for results, not run-time:

- **$0.10 per record** pushed to your dataset
- A negligible per-actor-start charge

No subscriptions, no seat licences, no per-CPU-second billing.

#### Worked cost example

A daily end-of-session pull of the full CSE price board — roughly 300 actively-quoted symbols:

- 300 records × $0.10 = **$30.00**
- plus one negligible actor-start charge

So roughly **$30 per full daily price pull**, or about **$0.10 per symbol** all-in. If you only track the day's top 25 movers, that run costs about **$2.50**. Either way it's a rounding error against a ~$12,000–$24,000 / year terminal seat whose Sri Lanka coverage is a sliver of what you'd be paying for.

#### Why pay-per-event beats time-based pricing

- **Predictable** — cost equals record count, known before the run.
- **Failure-safe** — if the CSE page changes and a run returns 0 rows, you pay 0.
- **Easy to attribute** — 1 record = 1 unit of cost, so per-strategy or per-fund accounting is trivial.

### How this compares to Bloomberg / FactSet

| Capability | Bloomberg / FactSet | Sri Lanka CSE Market Data (this actor) |
| --- | --- | --- |
| Sri Lanka CSE coverage | Yes, bundled in a global terminal | Yes, dedicated CSE feed |
| Breadth | Global markets (most of which you may not need) | Colombo Stock Exchange, focused |
| Annual cost | ~$12,000–$24,000 / seat / year | Pay-per-record, no subscription |
| Programmatic access | Seat-locked API (BLPAPI / FactSet API) | Apify REST API + webhooks, no seat lock |
| Pipe into your own model / warehouse | Restricted by terms | Native JSON / JSONL / CSV export |

If you need global multi-asset coverage, intraday tick data, and a full analytics workspace, a terminal is the right tool. But if your need is specifically Sri Lanka CSE prices and movers feeding a frontier allocation, an index sleeve, or a research pipeline, paying per record is the right cost model and a 95%+ saving versus a terminal seat you'd be renting mostly for other markets.

### FAQ

**Q: How current is the data?**

A: Each run reads the live CSE public pages, so prices reflect the current or most recently completed session. Schedule a run at session close to capture the official end-of-day board.

**Q: What does the `mode` parameter control?**

A: It selects which CSE dataset the run returns — today's share prices (per-symbol quotes), the top gainers/losers board, or the company-announcement stream.

**Q: Is this real-time tick data?**

A: No — it reads the CSE's published session prices (last traded, open, high, low), not a streaming tick feed. It's built for daily and intraday-snapshot workflows, not for high-frequency trading.

**Q: How do I build a price history?**

A: Run on a daily schedule and append each pull keyed on `symbol` + date into your warehouse; the CSE pages give you the current session, and your accumulation gives you the history.

**Q: What output formats are supported?**

A: JSON, JSONL, CSV, and Excel via Apify's dataset export, plus webhook delivery.

### Schema stability & versioning

This actor follows NexGenData's **additive-only schema** contract:

- New fields may be **added** at any time — they appear as new JSON keys and default to `null` for older runs.
- Existing fields are **never renamed or removed** without a major-version bump and an advance changelog notice.
- Field semantics (price units, the meaning of open/high/low) are **never silently changed** — if a change is needed, we add a new field and keep the old one for at least 90 days.

You can build production frontier-market pipelines on this actor without an unannounced change breaking your ETL.

### Compliance & legal

- The actor reads **public, unauthenticated Colombo Stock Exchange market pages** — the same pages any browser can open, with no login.
- Requests are paced politely and routed through Apify's compliant proxy infrastructure.
- NexGenData is **not affiliated with, endorsed by, or sponsored by** the Colombo Stock Exchange. "CSE" refers to the Colombo Stock Exchange.
- Prices and announcements are the CSE's published values; for any trade, settlement, or index-calculation decision, **verify against the primary CSE source**.
- You are responsible for ensuring downstream use complies with the CSE's terms and applicable Sri Lankan and local market-data regulations.

### Related NexGenData actors

Part of NexGenData's **International / Markets** intelligence suite — pair this actor with:

- [Korea KRX Market Statistics](https://apify.com/nexgendata/korea-krx-market-statistics?fpr=2ayu9b) — Korea Exchange market data
- [Taiwan PCC Public Procurement — Tenders & Awards](https://apify.com/nexgendata/taiwan-pcc-public-procurement-tenders-awards?fpr=2ayu9b) — Taiwan government tender data
- [Japan BOJ Macro Rates & JGB Auctions](https://apify.com/nexgendata/japan-boj-macro-rates-jgb-auctions?fpr=2ayu9b) — Bank of Japan rates and JGB auction results
- [Global Central Bank Policy Rates](https://apify.com/nexgendata/global-central-bank-policy-rates?fpr=2ayu9b) — policy rates across major central banks
- [Finviz Stock Screener](https://apify.com/nexgendata/finviz-stock-screener?fpr=2ayu9b) — US equities screening for cross-market context
- [Crypto Top 100 Screener](https://apify.com/nexgendata/crypto-top100-screener?fpr=2ayu9b) — top crypto assets by market cap

Browse the full catalog of 200+ buyer-intent actors at **https://apify.com/nexgendata?fpr=2ayu9b**.

# Actor input Schema

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

Data to fetch.

## `maxResults` (type: `integer`):

Max records.

## Actor input object example

```json
{
  "mode": "prices",
  "maxResults": 1000
}
```

# 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("nexgendata/sri-lanka-cse-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("nexgendata/sri-lanka-cse-market-data").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 nexgendata/sri-lanka-cse-market-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nexgendata/sri-lanka-cse-market-data",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🇱🇰 Sri Lanka CSE — Colombo Stock Exchange Data",
        "description": "Colombo Stock Exchange (Sri Lanka) market data: today's share prices, top gainers/losers, and company announcements. For frontier/emerging-market investors and index providers.",
        "version": "0.0",
        "x-build-id": "3FISziZdo1yePH4N9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/nexgendata~sri-lanka-cse-market-data/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-nexgendata-sri-lanka-cse-market-data",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/nexgendata~sri-lanka-cse-market-data/runs": {
            "post": {
                "operationId": "runs-sync-nexgendata-sri-lanka-cse-market-data",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/nexgendata~sri-lanka-cse-market-data/run-sync": {
            "post": {
                "operationId": "run-sync-nexgendata-sri-lanka-cse-market-data",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "prices",
                            "announcements",
                            "gainers",
                            "losers"
                        ],
                        "type": "string",
                        "description": "Data to fetch.",
                        "default": "prices"
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Max records.",
                        "default": 1000
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
