skills/lseg-data/SKILL.md
Use when "query LSEG/Refinitiv", "fundamentals or market data from LSEG", "ESG scores", "RIC/ISIN symbology", "corporate governance or activism (poison pills, campaigns)", "M&A or IPO deals", "syndicated loans or project finance", "PE/VC investments", "joint ventures", "municipal bonds", "Lipper fund details", "stock screening (fscreen)", "Refinitiv news", or any use of the `lseg.data` Python API. (For academic loan/PE data, WRDS DealScan/PitchBook may be the better source — the wrds skill covers those.)
npx skillsauth add edwinhu/workflows lseg-dataInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Access financial data from LSEG (London Stock Exchange Group), formerly Refinitiv, via the lseg.data Python library.
Before claiming ANY LSEG query succeeded, follow these steps:
.head() or .sample()This is not negotiable. Skipping result inspection is NOT HELPFUL — the user builds analysis on data with undetected quality problems.
.O, .N, .L, .T) before querying.get_data() 10,000 data points, get_history() 3,000 rows) — many small queries still hit the session cap. Batch instead of looping..head() or .sample() inspection → STOP. Handing over uninspected data gives the user undetected quality problems — unhelpful on its own terms.Before EVERY data retrieval claim, verify the following:
For ld.get_data() (fundamentals/ESG):
.head() or .sample() executedFor ld.get_history() (time series):
For symbol_conversion.Definition() (mapping):
For ALL queries:
open_session() at start, close_session() at endTo 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()
Configure LSEG authentication using either a config file or environment variables.
Create lseg-data.config.json:
{
“sessions”: {
“default”: “platform.ldp”,
“platform”: {
“ldp”: {
“app-key”: “YOUR_APP_KEY”,
“username”: “YOUR_MACHINE_ID”,
“password”: “YOUR_PASSWORD”
}
}
}
}
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”
| API | Use Case | Example |
|-----|----------|---------|
| ld.get_data() | Point-in-time data | Fundamentals, ESG scores |
| ld.get_history() | Time series | Historical prices, OHLCV |
| ld.news.get_headlines() | News headlines | Company news, topic filtering |
| symbol_conversion.Definition() | ID mapping | RIC ↔ ISIN ↔ CUSIP |
| Prefix | Type | Example |
|--------|------|---------|
| TR. | Refinitiv fields | TR.Revenue, TR.EPS |
| TR.MnA | Mergers & Acquisitions | TR.MnAAcquirorName, TR.MnADealValue |
| TR.NI | Equity/New Issues (IPOs) | TR.NIIssuer, TR.NIOfferPrice |
| TR.JV | Joint Ventures/Alliances | TR.JVDealName, TR.JVStatus |
| TR.SACT | Shareholder Activism | TR.SACTLeadDissident |
| TR.PP | Poison Pills | TR.PPPillAdoptionDate |
| TR.LN | Syndicated Loans | TR.LNTotalFacilityAmount |
| TR.PJF | Infrastructure/Project Finance | TR.PJFProjectName |
| TR.PEInvest | Private Equity/Venture Capital | TR.PEInvestRoundDate |
| TR.Muni | Municipal Bonds | TR.MuniIssuerName |
| CF_ | Composite (real-time) | CF_LAST, CF_BID |
| Suffix | Exchange | Example |
|--------|----------|---------|
| .O | NASDAQ | AAPL.O |
| .N | NYSE | IBM.N |
| .L | London | VOD.L |
| .T | Tokyo | 7203.T |
| Endpoint | Limit |
|----------|-------|
| get_data() | 10,000 data points/request |
| get_history() | 3,000 rows/request |
| Session | 500 requests/minute |
references/fundamentals.md - Financial statement fields, ratios, estimatesreferences/esg.md - ESG scores, pillars, controversiesreferences/symbology.md - RIC/ISIN/CUSIP conversionreferences/pricing.md - Historical prices, real-time datareferences/screening.md - Stock screening with Screener objectreferences/fscreen.md - Fund screening (ETFs, mutual funds) with FSCREEN appreferences/fund-details.md - Fund details and characteristicsreferences/news.md - News headlines, pagination, query syntaxreferences/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 monitoringreferences/troubleshooting.md - Common issues and solutionsreferences/wrds-comparison.md - LSEG vs WRDS data mappingexamples/historical_pricing.ipynb - Historical price retrievalexamples/fundamentals_query.py - Fundamental data patternsexamples/stock_screener.ipynb - Dynamic stock screeningscripts/test_connection.py - Validate LSEG connectivityLSEG API samples at ~/resources/lseg-samples/:
Example.RDPLibrary.Python/ - Core API examplesExamples.DataLibrary.Python.AdvancedUsecases/ - Advanced patternsArticle.DataLibrary.Python.Screener/ - Stock screeningInteractive JupyterLab environment with pre-configured LSEG access:
https://workspace.refinitiv.com/codebook/refinitiv.data library{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.
When querying market data, account for current date context and market data lag.
Market data typically has T-1 availability, meaning today’s data becomes available tomorrow. Adjust date ranges accordingly.
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.
tools
Use when "query Dewey Data", "deweydata.io", "SafeGraph places/patterns/spend", "Advan foot traffic", "POI / points of interest", "mobility data", "dataplor", "Veraset", "PassBy", "crypto/Bitcoin ATM locations", or any pull from the Dewey Data academic marketplace (UVA/NYU Platform Subscription) via the deweypy/deweydatapy client, DuckDB, or the Dewey MCP server.
development
Use when submitting jobs to UVA HPC (Rivanna/Afton), writing Slurm scripts (sbatch/srun/squeue), converting SGE to Slurm, running compute on any Slurm-managed cluster, or building WRDS data pipelines with polars on HPC. Triggers: 'submit to HPC', 'sbatch', 'squeue', 'slurm job', 'run on Rivanna', 'run on Afton', 'HPC array job', 'convert SGE to Slurm', 'polars on HPC', 'WRDS from HPC'.
testing
Internal skill for literature review and source materialization. Called after brainstorm, before setup. NOT user-facing.
development
This skill should be used when the user asks to "add paper", "paperpile add", "fetch PDF for", "find and add", "search paperpile", "find in paperpile", "paperpile search", "label paper", "trash paper", "download paper", "paperpile index", "edit paper metadata", "update paper title", "fix paper author", "paperpile edit", "find PDF online", "search google for PDF", "resolve PDF", "fetch PDF for citation", "get full-text for DOI", "resolve cite to PDF", or any request to manage their Paperpile library or resolve a citation to a local PDF.