Skip to content

Instantly share code, notes, and snippets.

@NixBiks
Created November 11, 2024 12:55
Show Gist options
  • Save NixBiks/4dfc00777f9abe4c46514ff31f81a267 to your computer and use it in GitHub Desktop.
Save NixBiks/4dfc00777f9abe4c46514ff31f81a267 to your computer and use it in GitHub Desktop.
External JSON Schema for Financial News Systems
{
"$defs": {
"Company": {
"description": "The company describes a company that in some way is referenceable.",
"properties": {
"company_id": {
"title": "The id of the company used by Financial News Systems",
"type": "string"
},
"name": {
"title": "The name of the company",
"type": "string"
},
"names": {
"default": [],
"items": {
"type": "string"
},
"title": "An array containing all historical names of the company",
"type": "array"
},
"isins": {
"default": [],
"items": {
"type": "string"
},
"title": "ISIN referring to stocks associated with company",
"type": "array"
},
"leis": {
"default": [],
"items": {
"type": "string"
},
"title": "References to the company by LEI, https://www.gleif.org/",
"type": "array"
},
"tickers": {
"default": [],
"items": {
"type": "string"
},
"title": "Publicly traded entities will have tickers attached to them they follow the pattern of primary_market_mic:symbol, eg XSTO:VOLV B",
"type": "array"
}
},
"required": [
"company_id",
"name"
],
"title": "Company",
"type": "object"
},
"Content": {
"description": "The news content contains the content of the news item",
"properties": {
"title": {
"title": "The headline of the news item",
"type": "string"
},
"body": {
"title": "The body of the news item in plain text as unicode. It's possible to include the body in HTML (as well as markdown) instead or in addition to plain text",
"type": "string"
},
"alert_level": {
"default": "normal",
"enum": [
"high",
"normal"
],
"title": "The alert level of the news item",
"type": "string"
}
},
"required": [
"title",
"body"
],
"title": "Content",
"type": "object"
},
"Extension": {
"description": "The extension object is a placeholder for future metadata that might be added to the news item. This is to allow for a more flexible model that can be extended in the future without breaking the API.",
"properties": {},
"title": "Extension",
"type": "object"
},
"Properties": {
"description": "The properties object contains metadata about the news item.",
"properties": {
"lang": {
"const": "en",
"enum": [
"en"
],
"title": "The language of newsitem.content, ISO-639-1. Only 'en' is supported at the moment",
"type": "string"
},
"tags": {
"default": [],
"items": {
"enum": [
"acquisition",
"earnings",
"outlook",
"drug_approval"
],
"type": "string"
},
"title": "Tags that can be used to categorize the news item",
"type": "array"
},
"revision_number": {
"title": "A number that is increased each time the news item is updated. The first revision will have the number 1",
"type": "integer"
},
"news_id": {
"title": "The unique identifier for the news item",
"type": "string"
},
"revision_id": {
"title": "The unique identifier for the news item revision",
"type": "string"
},
"group_id": {
"title": "The unique identifier for the group of news items",
"type": "string"
},
"trace_id": {
"pattern": "^[0-9a-f]{32}$",
"title": "The trace id when the news item was created",
"type": "string"
},
"first_created": {
"format": "date-time",
"title": "RFC3339 time format, 2006-01-02T15:04:05Z07:00",
"type": "string"
},
"revision_created": {
"format": "date-time",
"title": "RFC3339 time format, 2006-01-02T15:04:05Z07:00",
"type": "string"
}
},
"required": [
"lang",
"revision_number",
"news_id",
"revision_id",
"group_id",
"trace_id",
"first_created",
"revision_created"
],
"title": "Properties",
"type": "object"
}
},
"description": "This is the main model that Financial News Systems delivers through its APIs. Our objective to be very clear about the following\n\n- Who the company is (`company`)\n- Who is being referenced in the news item (`subjects`)\n- What it is regarding (`properties`)",
"examples": [
{
"company": {
"company_id": "802ed548-9f51-446c-8124-c10bb4b39e38",
"isins": [
"US80874P1093"
],
"leis": [],
"local_refs": [],
"name": "Light & Wonder",
"names": [
"Light & Wonder"
],
"tickers": []
},
"content": {
"alert_level": "normal",
"body": "Light & Wonder Q2 capex USD 86 million.\n\u2022 Q2 net income USD 82 million vs. estimate USD 96.6 million\n\u2022 Q2 adjusted EBITDA USD 330 million vs. estimate USD 308.7 million\n\u2022 Q2 free cash flow USD 70 million",
"title": "Light & Wonder Q2 Revenue USD 818 Million Vs. Estimate USD 797.6 Million"
},
"properties": {
"lang": "en",
"tags": [
"earnings"
],
"news_id": "450e0bb9-829b-4188-a8d8-4379ef8d14bd",
"revision_id": "46677d3f-6e94-446d-a086-a74990ff7000",
"group_id": "bde15d08-19c9-4333-805d-56b32e820903",
"trace_id": "f524bad987824dd4b6e645a79d9771ba",
"revision_number": 1,
"first_created": "2024-08-07T13:30:00Z",
"revision_created": "2024-08-07T13:30:00Z"
},
"source": "fns",
"subjects": [
{
"company_id": "802ed548-9f51-446c-8124-c10bb4b39e38",
"isins": [
"US80874P1093"
],
"leis": [],
"local_refs": [],
"name": "Light & Wonder",
"names": [
"Light & Wonder"
],
"tickers": []
}
]
},
{
"company": {
"company_id": "802ed548-9f51-446c-8124-c10bb4b39e38",
"isins": [
"US80874P1093"
],
"leis": [],
"local_refs": [],
"name": "Light & Wonder",
"names": [
"Light & Wonder"
],
"tickers": []
},
"content": {
"alert_level": "high",
"body": "",
"title": "Light & Wonder Q2 Revenue USD 818 Million Vs. Estimate USD 797.6 Million"
},
"properties": {
"lang": "en",
"tags": [
"earnings"
],
"news_id": "13c428bb-62bf-487d-9342-9cc3a50c2ff4",
"revision_id": "02c2548e-6b4d-46c3-8c94-30e8032aadb5",
"group_id": "bde15d08-19c9-4333-805d-56b32e820903",
"trace_id": "cac0a1d105e842a4b35a32606d814a5a",
"revision_number": 1,
"first_created": "2024-08-07T13:30:00Z",
"revision_created": "2024-08-07T13:30:00Z"
},
"source": "fns",
"subjects": [
{
"company_id": "802ed548-9f51-446c-8124-c10bb4b39e38",
"isins": [
"US80874P1093"
],
"leis": [],
"local_refs": [],
"name": "Light & Wonder",
"names": [
"Light & Wonder"
],
"tickers": []
}
]
}
],
"properties": {
"company": {
"$ref": "#/$defs/Company",
"title": "An object describing who is the author of the news item"
},
"subjects": {
"default": [],
"items": {
"$ref": "#/$defs/Company"
},
"title": "An array of objects describing who the news item relates to",
"type": "array"
},
"properties": {
"$ref": "#/$defs/Properties",
"title": "An object containing properties relating to the news item"
},
"content": {
"$ref": "#/$defs/Content",
"title": "An object containing the content of the news item"
},
"source": {
"const": "fns",
"default": "fns",
"enum": [
"fns"
],
"title": "The source of the news item. This is always fns (Financial News Systems)",
"type": "string"
},
"extensions": {
"$ref": "#/$defs/Extension",
"default": {},
"title": "An object where new types of metadata might be added later"
}
},
"required": [
"company",
"properties",
"content"
],
"title": "NewsItem",
"type": "object"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment