Skip to content
lseg-data logo

LSEG Data Library

lseg-data

This skill should be used when the user asks to “access LSEG data”, “query Refinitiv”, “get market data from Refinitiv”, “download fundamentals from LSEG”, “access ESG scores”, “convert RIC to ISIN”, “get shareholder activism data”, “query poison pills”, “access corporate governance data”, “find ...

SKILL.md

Full skill instructions

Contents

LSEG Data Library

Access financial data from LSEG (London Stock Exchange Group), formerly Refinitiv, via the lseg.data Python library.

Query Enforcement

IRON LAW: NO DATA CLAIM WITHOUT SAMPLE INSPECTION

Before claiming ANY LSEG query succeeded, follow these steps:

  1. VALIDATE field names exist (check prefixes: TR., CF_)
  2. VALIDATE RIC symbology is correct (.O, .N, .L, .T)
  3. EXECUTE the query
  4. INSPECT sample rows with .head() or .sample()
  5. VERIFY critical columns are not NULL
  6. VERIFY date range matches expectations
  7. CLAIM success only after all checks pass

This is not negotiable. Claiming data retrieval without inspecting results is LYING to the user about data quality.

Rationalization Table - STOP If You Think:

ExcuseRealityDo Instead
“The query returned data, so it worked”Returned data ≠ correct dataINSPECT for NULLs, wrong dates, invalid values
“User gave me the RIC”Users often use wrong suffixesVERIFY symbology against RIC Symbology section
“I’ll let pandas handle missing data”You’ll propagate bad data downstreamCHECK for NULLs BEFORE returning
“Field names look right”Typos are common (TR.EPS vs TR.Eps)VALIDATE field names in documentation first
“Just a quick test”Test queries teach bad habitsFull validation even for tests
“I can check the data later”You won’tInspection is MANDATORY before claiming success
“Rate limits don’t matter for small queries”Small queries add upCHECK rate limits section, use batching

Red Flags - STOP Immediately If You Think:

  • “Let me run this and see what happens” → NO. Validate field names and RICs FIRST.
  • “The API will error if something is wrong” → NO. API returns empty results, not errors.
  • “I’ll just return the dataframe to the user” → NO. Inspect sample BEFORE returning.
  • “Market data is always up-to-date” → NO. Check Date Awareness section (T-1 lag).

Data Validation Checklist

Before EVERY data retrieval claim, verify the following:

For ld.get_data() (fundamentals/​ESG):

  • Field names use correct prefix (TR. for Refinitiv)
  • RIC symbology verified (correct exchange suffix)
  • Result inspection: .head() or .sample() executed
  • NULL check on critical fields (e.g., revenue, EPS)
  • Row count verification (is result size reasonable?)
  • Date context verified (fiscal periods, as-of dates)

For ld.get_history() (time series):

  • Field names are valid (OPEN, HIGH, LOW, CLOSE, VOLUME, or CF_ prefixes)
  • Start/​end dates specified explicitly
  • Date range adjusted for T-1 availability (market data lag)
  • Result inspection: check first and last rows
  • NULL check on OHLCV fields
  • Date continuity check (gaps in trading days expected, but not in date sequence)

For symbol_conversion.Definition() (mapping):

  • Input identifier type specified correctly
  • Result inspection: verify mapped values exist
  • NULL check (some securities may not have all identifiers)

For ALL queries:

  • Rate limits considered (batch if >10k data points)
  • Session management: open_session() at start, close_session() at end
  • Error handling: try/​except for network failures
  • Sample inspection BEFORE claiming data is ready

Quick Start

To get started with LSEG Data Library, initialize a session and execute queries:

import lseg.data as ld

# Initialize session
ld.open_session()

# Get fundamentals
df = ld.get_data(
    universe=[‘AAPL.O’, ‘MSFT.O’],
    fields=[‘TR.CompanyName’, ‘TR.Revenue’, ‘TR.EPS’]
)
print(df.head())  # Inspect sample data

# Get historical prices
prices = ld.get_history(
    universe=’AAPL.O’,
    fields=[‘OPEN’, ‘HIGH’, ‘LOW’, ‘CLOSE’, ‘VOLUME’],
    start=‘2023-01-01’,
    end=‘2023-12-31’
)
print(prices.head())  # Inspect sample data

# Close session
ld.close_session()

Authentication

Configure LSEG authentication using either a config file or environment variables.

Config File Method

Create lseg-data.config.json:

{
  “sessions”: {
    “default”: “platform.ldp”,
    “platform”: {
      “ldp”: {
        “app-key”: “YOUR_APP_KEY”,
        “username”: “YOUR_MACHINE_ID”,
        “password”: “YOUR_PASSWORD”
      }
    }
  }
}

Environment Variables Method

Set the following environment variables for LSEG authentication:

# Configure LSEG credentials via environment variables
export RDP_USERNAME=”YOUR_MACHINE_ID”
export RDP_PASSWORD=”YOUR_PASSWORD”
export RDP_APP_KEY=”YOUR_APP_KEY”

Core APIs

APIUse CaseExample
ld.get_data()Point-in-time dataFundamentals, ESG scores
ld.get_history()Time seriesHistorical prices, OHLCV
ld.news.get_headlines()News headlinesCompany news, topic filtering
symbol_conversion.Definition()ID mappingRIC ↔ ISIN ↔ CUSIP

Key Field Prefixes

PrefixTypeExample
TR.Refinitiv fieldsTR.Revenue, TR.EPS
TR.MnAMergers & AcquisitionsTR.MnAAcquirorName, TR.MnADealValue
TR.NIEquity/​New Issues (IPOs)TR.NIIssuer, TR.NIOfferPrice
TR.JVJoint Ventures/​AlliancesTR.JVDealName, TR.JVStatus
TR.SACTShareholder ActivismTR.SACTLeadDissident
TR.PPPoison PillsTR.PPPillAdoptionDate
TR.LNSyndicated LoansTR.LNTotalFacilityAmount
TR.PJFInfrastructure/​Project FinanceTR.PJFProjectName
TR.PEInvestPrivate Equity/​Venture CapitalTR.PEInvestRoundDate
TR.MuniMunicipal BondsTR.MuniIssuerName
CF_Composite (real-time)CF_LAST, CF_BID

RIC Symbology

SuffixExchangeExample
.ONASDAQAAPL.O
.NNYSEIBM.N
.LLondonVOD.L
.TTokyo7203.T

Rate Limits

EndpointLimit
get_data()10,000 data points/​request
get_history()3,000 rows/​request
Session500 requests/​minute

Additional Resources

Reference Files

  • references/​fundamentals.md - Financial statement fields, ratios, estimates
  • references/​esg.md - ESG scores, pillars, controversies
  • references/​symbology.md - RIC/​ISIN/​CUSIP conversion
  • references/​pricing.md - Historical prices, real-time data
  • references/​screening.md - Stock screening with Screener object
  • references/​news.md - News headlines, pagination, query syntax
  • references/​mna.md - Mergers & acquisitions deals (SDC Platinum, 2,683 fields)
  • references/​equity-new-issues.md - IPOs, follow-ons, equity offerings (SDC Platinum, 1,708 fields)
  • references/​joint-ventures.md - Joint ventures, strategic alliances (SDC Platinum, 301 fields)
  • references/​corporate-governance.md - Shareholder activism, poison pills (SDC Platinum)
  • references/​syndicated-loans.md - Syndicated loan deals (SDC Platinum)
  • references/​infrastructure.md - Infrastructure/​project finance deals (SDC Platinum)
  • references/​private-equity.md - Private equity/​venture capital investments (SDC Platinum)
  • references/​municipal-bonds.md - Municipal bond issuances (SDC Platinum)
  • references/​api-discovery.md - Reverse-engineering APIs via CDP network monitoring
  • references/​troubleshooting.md - Common issues and solutions
  • references/​wrds-comparison.md - LSEG vs WRDS data mapping

Example Files

  • examples/​historical_pricing.ipynb - Historical price retrieval
  • examples/​fundamentals_query.py - Fundamental data patterns
  • examples/​stock_screener.ipynb - Dynamic stock screening

Scripts

  • scripts/​test_connection.py - Validate LSEG connectivity

Local Sample Repositories

LSEG API samples at ~/​resources/​lseg-samples/:

  • Example.RDPLibrary.Python/ - Core API examples
  • Examples.DataLibrary.Python.AdvancedUsecases/ - Advanced patterns
  • Article.DataLibrary.Python.Screener/ - Stock screening

Refinitiv Codebook

Interactive JupyterLab environment with pre-configured LSEG access:

  • URL: https://workspace.refinitiv.com/​codebook/
  • Environment: JupyterHub with Python 3.8, pre-installed refinitiv.data library
  • Session: Auto-authenticated via Workspace credentials ({name=’codebook’})
# In Codebook, session opens automatically with Workspace auth
import refinitiv.data as rd
rd.open_session()  # Returns session with name=’codebook’

# Query data immediately
df = rd.news.get_headlines(‘R:AAPL.O AND SUGGAC’, count=10)

Note: Codebook uses refinitiv.data (older name) rather than lseg.data. Both APIs are equivalent.

Date Awareness

When querying market data, account for current date context and market data lag.

Market Data Lag

Market data typically has T-1 availability, meaning today’s data becomes available tomorrow. Adjust date ranges accordingly.

Date Range Example

Use current date context when querying historical prices:

from datetime import datetime, timedelta

# Get recent market data
end_date = datetime.now()
start_date = end_date - timedelta(days=365)

# Adjust to exclude recent data (T-1 for market data availability)
end_date = end_date - timedelta(days=1)

df = ld.get_history(
    universe=”AAPL.O”,
    fields=[‘CLOSE’],
    start=start_date.strftime(‘%Y-%m-%d’),
    end=end_date.strftime(‘%Y-%m-%d’)
)

Remember: Always account for the T-1 lag in market data availability.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View