financial_services_register_api.api

class financial_services_register_api.api.FinancialServicesRegisterApiClient(api_username: str, api_key: str)[source]

Client for the Financial Services Register API (V0.1).

Consult the API documentation for further details.

https://register.fca.org.uk/Developer/s/

Attributes

api_session

The API session instance.

api_version

The API version being used by the client.

Methods

common_search(resource_name, resource_type)

FinancialServicesRegisterApiResponse: Returns a response containing the results of a search using the FS Register API common search API endpoint.

get_firm(frn)

FinancialServicesRegisterApiResponse: Returns a response containing firm details, given its firm reference number (FRN)

get_firm_addresses(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the address details of a firm, given its firm reference number (FRN).

get_firm_appointed_representatives(frn)

FinancialServicesRegisterApiResponse: Returns a response containing information on the appointed representatives of a firm, given its firm reference number (FRN).

get_firm_controlled_functions(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the controlled functions associated with a firm ,given its firm reference number (FRN).

get_firm_disciplinary_history(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the disciplinary history of a firm, given its firm reference number (FRN).

get_firm_exclusions(frn)

FinancialServicesRegisterApiResponse: Returns a response containing any exclusions applying to a firm, given its firm reference number (FRN).

get_firm_individuals(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the individuals associated with a firm, given its firm reference number (FRN).

get_firm_names(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the alternative or secondary trading name details of a firm, given its firm reference number (FRN).

get_firm_passport_permissions(frn, country)

FinancialServicesRegisterApiResponse: Returns a response containing country-specific passport permissions for a firm and a country, given its firm reference number (FRN) and country name.

get_firm_passports(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the passports associated with a firm, given its firm reference number (FRN).

get_firm_permissions(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the permissions associated with a firm, given its firm reference number (FRN).

get_firm_regulators(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the regulators associated with a firm, given its firm reference number (FRN).

get_firm_requirement_investment_types(frn, ...)

FinancialServicesRegisterApiResponse: Returns a response containing any investment types listed for a specific requirement associated with a firm, given its firm reference number (FRN).

get_firm_requirements(frn)

FinancialServicesRegisterApiResponse: Returns a response containing the requirements associated with a firm, given its firm reference number (FRN).

get_firm_waivers(frn)

FinancialServicesRegisterApiResponse: Returns a response containing any waivers applying to a firm, given its firm reference number (FRN).

get_fund(prn)

FinancialServicesRegisterApiResponse : Returns a response containing fund (or collective investment scheme (CIS)) details, given its product reference number (PRN)

get_fund_names(prn)

FinancialServicesRegisterApiResponse : Returns a response containing the alternative or secondary trading name details of a fund (or collective investment scheme (CIS)), given its product reference number (PRN).

get_fund_subfunds(prn)

FinancialServicesRegisterApiResponse : Returns a response containing the subfund details of a fund (or collective investment scheme (CIS)), given its product reference number (PRN).

get_individual(irn)

FinancialServicesRegisterApiResponse : Returns a response containing individual details, given their individual reference number (IRN)

get_individual_controlled_functions(irn)

FinancialServicesRegisterApiResponse : Returns a response containing the controlled functions associated with an individual, given their individual reference number (FRN).

get_individual_disciplinary_history(irn)

FinancialServicesRegisterApiResponse : Returns a response containing the disciplinary history of an individual, given their individual reference number (FRN).

get_regulated_markets()

FinancialServicesRegisterApiResponse : Returns a response containing details of all current regulated markets, as defined in UK and EU / EEA financial services legislation.

search_frn(firm_name)

str or list: Returns the unique firm reference number (FRN) of a given firm, if found, or else a JSON array of matching records.

search_irn(individual_name)

str or list: Returns the unique individual reference number (IRN) of a given individual, if found, or else a JSON array of matching records.

search_prn(fund_name)

str or list: Returns the unique product reference number (PRN) of a given fund, if found, or else a JSON array of matching records.

Examples

>>> import os; from urllib.parse import urlencode
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.common_search('Hastings Direct', 'firm')
>>> res
<Response [200]>
>>> assert res.data
>>> assert res.status
>>> assert res.message
>>> assert res.resultinfo
>>> client.search_frn("Hastings Insurance Services Limited")
'311492'
>>> res = client.search_frn('direct line')
>>> assert isinstance(res, list)
>>> assert (isinstance(rec, dict) for rec in res)
>>> client.search_frn('direct line insurance plc')
'202684'
>>> assert client.get_firm('122702').data
>>> assert client.get_individual('MXC29012').data
>>> try:
...     assert client.get_fund('635641').data
... except AssertionError:
...     pass
__init__(api_username: str, api_key: str) None[source]

Initialiser requiring the API username and key.

Parameters:
api_usernamestr

The API username, which will be the email used to sign up on the developer portal:

https://register.fca.org.uk/Developer/s/

api_keystr

The API key obtained from the registration profile on the developer portal.

Examples

>>> import os; from financial_services_register_api.constants import FINANCIAL_SERVICES_REGISTER_API_CONSTANTS as API_CONSTANTS
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> assert client.api_session.api_username == os.environ['API_USERNAME']
>>> assert client.api_session.api_key == os.environ['API_KEY']
>>> assert client.api_session.headers == {'ACCEPT': 'application/json', 'X-AUTH-EMAIL': os.environ['API_USERNAME'], 'X-AUTH-KEY': os.environ['API_KEY']}
>>> assert client.api_version == API_CONSTANTS.API_VERSION.value
property api_session: FinancialServicesRegisterApiSession

The API session instance.

Returns:
FinancialServicesRegisterApiSession

The current FinancialServicesRegisterApiSession object.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> assert isinstance(client.api_session, FinancialServicesRegisterApiSession)
Type:

FinancialServicesRegisterApiSession

property api_version: str

The API version being used by the client.

Returns:
str

The API version being used by the client.

Examples

>>> import os; from financial_services_register_api.constants import FINANCIAL_SERVICES_REGISTER_API_CONSTANTS as API_CONSTANTS
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> assert client.api_version == API_CONSTANTS.API_VERSION.value
Type:

str

FinancialServicesRegisterApiResponse: Returns a response containing the results of a search using the FS Register API common search API endpoint.

Directly calls the API common search endpoint:

/V0.1/Search?q=resource_name>&type=resource_type

to perform a case-insensitive search in the FS Register on the given resource name (or name substring) and resource type ("firm", "individual", "fund").

Returns an FinancialServicesRegisterApiResponse object if the API call completes without exceptions or errors.

Parameters:
resource_namestr

The name (or name substring) of a resource to search for in the FS Register, e.g. "ABC Company", "John Smith", "International Super Fund".

resource_typestr

The resource type to search for - according to the API this must be one of the following strings: "firm", "individual", or "fund".

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Raises:
FinancialServicesRegisterApiRequestException

If there was a requests.RequestException in making the original request.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.common_search('Hastings Direct', 'firm')
>>> res
<Response [200]>
>>> assert res.data
>>> assert res.status
>>> assert res.message
>>> assert res.resultinfo
search_frn(firm_name: str) str | list[dict[str, str]][source]

str or list: Returns the unique firm reference number (FRN) of a given firm, if found, or else a JSON array of matching records.

Calls the private method _search_ref_number() to do the search.

Returns a non-null string of the FRN if there is a unique associated firm. Otherwise, a JSON array of all matching records is returned.

Parameters:
firm_namestr

The firm name (case insensitive). The name needs to be precise enough to guarantee a unique return value, otherwise a JSON array of all matching records are returned.

Returns:
str

A string version of the firm reference number (FRN), if found, or a JSON array of all matching records.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> client.search_frn("Hastings Insurance Services Limited")
'311492'
>>> client.search_frn('hiscox insurance company limited')
'113849'
>>> res = client.search_frn('direct line')
>>> assert isinstance(res, list)
>>> assert all(isinstance(rec, dict) for rec in res)
>>> client.search_frn('hiscox insurance company')
'113849'
>>> client.search_frn('nonexistent company')
Traceback (most recent call last):
...
financial_services_register_api.exceptions.FinancialServicesRegisterApiRequestException: No data found in the API response. Please check the search parameters and try again.
get_firm(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing firm details, given its firm reference number (FRN)

Handler for the top-level firm details API endpoint:

/V0.1/Firm/{FRN}

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm('122702')
>>> res
<Response [200]>
>>> assert res.data[0]['Organisation Name'] == 'Barclays Bank Plc'
>>> res = client.get_firm('1234567890')
>>> assert not res.data
get_firm_names(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the alternative or secondary trading name details of a firm, given its firm reference number (FRN).

Handler for the firm names API endpoint:

/V0.1/Firm/{FRN}/Names

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_names('122702')
>>> res
<Response [200]>
>>> assert res.data[0]['Current Names']
>>> assert res.data[1]['Previous Names']
>>> res = client.get_firm_names('1234567890')
>>> assert not res.data
get_firm_addresses(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the address details of a firm, given its firm reference number (FRN).

Handler for the firm address details API endpoint:

/V0.1/Firm/{FRN}/Address

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_addresses('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_addresses('1234567890')
>>> assert not res.data
get_firm_controlled_functions(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the controlled functions associated with a firm ,given its firm reference number (FRN).

Handler for the firm controlled functions API endpoint:

/V0.1/Firm/{FRN}/CF

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_controlled_functions('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_controlled_functions('1234567890')
>>> assert not res.data
get_firm_individuals(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the individuals associated with a firm, given its firm reference number (FRN).

Handler for the firm individuals API endpoint:

/V0.1/Firm/{FRN}/Individuals

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_individuals('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_individuals('1234567890')
>>> assert not res.data
get_firm_permissions(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the permissions associated with a firm, given its firm reference number (FRN).

Handler for the firm permissions API endpoint:

/V0.1/Firm/{FRN}/Permissions

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_permissions('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_permissions('1234567890')
>>> assert not res.data
get_firm_requirements(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the requirements associated with a firm, given its firm reference number (FRN).

Handler for the firm requirements API endpoint:

/V0.1/Firm/{FRN}/Requirements

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_requirements('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_requirements('1234567890')
>>> assert not res.data
get_firm_requirement_investment_types(frn: str, req_ref: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing any investment types listed for a specific requirement associated with a firm, given its firm reference number (FRN).

Handler for the firm requirement investment types API endpoint:

/V0.1/Firm/{FRN}/Requirements/<ReqRef>/InvestmentTypes

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

req_refstr

The requirement reference number as a string.

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_requirement_investment_types('122702', 'OR-0262545')
>>> assert res.data
>>> res = client.get_firm_requirement_investment_types('1234567890', 'OR-0262545')
>>> assert not res.data
get_firm_regulators(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the regulators associated with a firm, given its firm reference number (FRN).

Handler for the firm regulators API endpoint:

/V0.1/Firm/{FRN}/Regulators

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_regulators('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_regulators('1234567890')
>>> assert not res.data
get_firm_passports(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the passports associated with a firm, given its firm reference number (FRN).

Handler for the firm passports API endpoint:

/V0.1/Firm/{FRN}/Passports

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_passports('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_passports('1234567890')
>>> assert not res.data
get_firm_passport_permissions(frn: str, country: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing country-specific passport permissions for a firm and a country, given its firm reference number (FRN) and country name.

Handler for the firm passport permissions API endpoint:

/V0.1/Firm/{FRN}/Requirements/{Country}/Permission

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

countrystr

The country name.

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_passport_permissions('122702', 'Gibraltar')
>>> assert res.data
>>> res = client.get_firm_passport_permissions('1234567890', 'Gibraltar')
>>> assert not res.data
get_firm_waivers(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing any waivers applying to a firm, given its firm reference number (FRN).

Handler for the firm waivers API endpoint:

/V0.1/Firm/{FRN}/Waivers

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_waivers('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_waivers('1234567890')
>>> assert not res.data
get_firm_exclusions(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing any exclusions applying to a firm, given its firm reference number (FRN).

Handler for the firm exclusions API endpoint:

/V0.1/Firm/{FRN}/Exclusions

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_exclusions('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_exclusions('1234567890')
>>> assert not res.data
get_firm_disciplinary_history(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing the disciplinary history of a firm, given its firm reference number (FRN).

Handler for the firm disciplinary history API endpoint:

/V0.1/Firm/{FRN}/DisciplinaryHistory

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_disciplinary_history('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_firm_disciplinary_history('1234567890')
>>> assert not res.data
get_firm_appointed_representatives(frn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse: Returns a response containing information on the appointed representatives of a firm, given its firm reference number (FRN).

Handler for the firm appointed representatives API endpoint:

/V0.1/Firm/{FRN}/AR

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
frnstr

The firm reference number (FRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the FRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_firm_appointed_representatives('122702')
>>> res
<Response [200]>
>>> assert res.data
>>> assert any([res.data['PreviousAppointedRepresentatives'], res.data['CurrentAppointedRepresentatives']])
>>> res = client.get_firm_appointed_representatives('1234567890')
>>> assert not any([res.data['PreviousAppointedRepresentatives'], res.data['CurrentAppointedRepresentatives']])
search_irn(individual_name: str) str | list[dict[str, str]][source]

str or list: Returns the unique individual reference number (IRN) of a given individual, if found, or else a JSON array of matching records.

Calls the private method _search_ref_number() to do the search.

Returns a non-null string of the IRN if there is a unique associated individual. Otherwise, a JSON array of all matching records is returned.

Parameters:
firm_namestr

The individual name (case insensitive). The name needs to be precise enough to guarantee a unique return value, otherwise a JSON array of all matching records are returned.

Returns:
str

A string version of the individual reference number (IRN), if found, or a JSON array of all matching records.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> client.search_irn('Mark Carney')
'MXC29012'
>>> client.search_irn('mark Carney')
'MXC29012'
>>> res = client.search_irn('Mark C')
>>> assert isinstance(res, list)
>>> assert all(isinstance(rec, dict) for rec in res)
>>> client.search_irn('nonexistent individual')
Traceback (most recent call last):
...
financial_services_register_api.exceptions.FinancialServicesRegisterApiRequestException: No data found in the API response. Please check the search parameters and try again.
get_individual(irn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse : Returns a response containing individual details, given their individual reference number (IRN)

Handler for top-level individual details API endpoint:

/V0.1/Individuals/{IRN}

Returns a FinancialServicesRegisterApiResponse, with data if the IRN is found, otherwise with no data.

Parameters:
irnstr

The individual reference number (IRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the IRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_individual('MXC29012')
>>> res
<Response [200]>
>>> assert res.data[0]['Details']['Full Name'] == 'Mark Carney'
>>> res = client.get_individual('1234567890')
>>> assert not res.data
get_individual_controlled_functions(irn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse : Returns a response containing the controlled functions associated with an individual, given their individual reference number (FRN).

Handler for the individual controlled functions API endpoint:

/V0.1/Firm/{IRN}/CF

Returns a FinancialServicesRegisterApiResponse, with data if the IRN is found, otherwise with no data.

Parameters:
irnstr

The individual reference number (IRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapepr of the API response object - there may be no data in the response if the IRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_individual_controlled_functions('MXC29012')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_individual_controlled_functions('1234567890')
>>> assert not res.data
get_individual_disciplinary_history(irn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse : Returns a response containing the disciplinary history of an individual, given their individual reference number (FRN).

Handler for the individual disciplinary history API endpoint:

/V0.1/Firm/{IRN}/DisciplinaryHistory

Returns a FinancialServicesRegisterApiResponse, with data if the IRN is found, otherwise with no data.

Parameters:
irnstr

The individual reference number (IRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the IRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> client.search_irn('Leigh Mackey')
'LXM01328'
>>> res = client.get_individual_disciplinary_history('LXM01328')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_individual_disciplinary_history('1234567890')
>>> assert not res.data
search_prn(fund_name: str) str | list[dict[str, str]][source]

str or list: Returns the unique product reference number (PRN) of a given fund, if found, or else a JSON array of matching records.

Calls the private method _search_ref_number() to do the search.

Returns a non-null string of the PRN if there is a unique associated fund. Otherwise, a JSON array of all matching records is returned.

Parameters:
firm_namestr

The fund name (case insensitive). The name needs to be precise enough to guarantee a unique return value, otherwise a JSON array of all matching records are returned.

Returns:
str

A string version of the product reference number (PRN), if found, or a JSON array of all matching records.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> client.search_prn('Northern Trust High Dividend ESG World Equity Feeder Fund')
'913937'
>>> res = client.search_prn('Northern Trust')
>>> assert isinstance(res, list)
>>> assert all(isinstance(rec, dict) for rec in res)
>>> client.search_prn('nonexistent fund')
Traceback (most recent call last):
...
financial_services_register_api.exceptions.FinancialServicesRegisterApiRequestException: No data found in the API response. Please check the search parameters and try again.
get_fund(prn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse : Returns a response containing fund (or collective investment scheme (CIS)) details, given its product reference number (PRN)

Handler for top-level fund details API endpoint:

/V0.1/CIS/{PRN}

Returns a FinancialServicesRegisterApiResponse, with data if the PRN is found, otherwise with no data.

Parameters:
prnstr

The product reference number (PRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the PRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> try:
...     res = client.get_fund('185045')
...     assert res.data
... except AssertionError:
...     pass
get_fund_names(prn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse : Returns a response containing the alternative or secondary trading name details of a fund (or collective investment scheme (CIS)), given its product reference number (PRN).

Handler for top-level fund names API endpoint:

/V0.1/CIS/{PRN}/Names

Returns a FinancialServicesRegisterApiResponse, with data if the PRN is found, otherwise with no data.

Parameters:
prnstr

The product reference number (PRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the PRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_fund_names('185045')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_fund_names('1234567890')
>>> assert not res.data
__weakref__

list of weak references to the object

get_fund_subfunds(prn: str) FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse : Returns a response containing the subfund details of a fund (or collective investment scheme (CIS)), given its product reference number (PRN).

Handler for top-level subfund details API endpoint:

/V0.1/CIS/{PRN}/Subfund

Returns a FinancialServicesRegisterApiResponse, with data if the FRN is found, otherwise with no data.

Parameters:
prnstr

The product reference number (PRN).

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the PRN isn’t found.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_fund_subfunds('185045')
>>> res
<Response [200]>
>>> assert res.data
>>> res = client.get_fund_subfunds('1234567890')
>>> assert not res.data
get_regulated_markets() FinancialServicesRegisterApiResponse[source]

FinancialServicesRegisterApiResponse : Returns a response containing details of all current regulated markets, as defined in UK and EU / EEA financial services legislation.

For further information consult the API documentation:

https://register.fca.org.uk/Developer/s/

or the FCA glossary:

https://www.handbook.fca.org.uk/handbook/glossary/G978.html?date=2007-01-20

Returns:
FinancialServicesRegisterApiResponse

Wrapper of the API response object - there may be no data in the response if the common search query produces no results.

Examples

>>> import json, os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.get_regulated_markets()
>>> print(json.dumps(res.data, indent=True))
[
 {
  "Name": "The London Metal Exchange",
  "TradingName": "",
  "Type of business or Individual": "Exchange - RM",
  "Reference Number": "",
  "Status": "",
  "FirmURL": "https://register.fca.org.uk/services/V0.1/Firm/"
 },
 {
  "Name": "ICE Futures Europe",
  "TradingName": "",
  "Type of business or Individual": "Exchange - RM",
  "Reference Number": "",
  "Status": "",
  "FirmURL": "https://register.fca.org.uk/services/V0.1/Firm/"
 },
 {
  "Name": "London Stock Exchange",
  "TradingName": "",
  "Type of business or Individual": "Exchange - RM",
  "Reference Number": "",
  "Status": "",
  "FirmURL": "https://register.fca.org.uk/services/V0.1/Firm/"
 },
 {
  "Name": "Aquis Stock Exchange Limited",
  "TradingName": "ICAP Securities & Derivatives Exchange Limited",
  "Type of business or Individual": "Exchange - RM",
  "Reference Number": "",
  "Status": "",
  "FirmURL": "https://register.fca.org.uk/services/V0.1/Firm/"
 },
 {
  "Name": "Cboe Europe Equities Regulated Market",
  "TradingName": "",
  "Type of business or Individual": "Exchange - RM",
  "Reference Number": "",
  "Status": "",
  "FirmURL": "https://register.fca.org.uk/services/V0.1/Firm/"
 }
]
class financial_services_register_api.api.FinancialServicesRegisterApiResponse(response: Response)[source]

A simple requests.Response-based wrapper for the API responses.

Attributes

data

The data in the API response.

message

The status message in the API response.

resultinfo

The pagination information in the API response.

status

The status code of the API response.

Examples

>>> import os
>>> client = FinancialServicesRegisterApiClient(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> res = client.common_search('Hastings Direct', 'firm')
>>> res
<Response [200]>
__init__(response: Response) None[source]

Initialiser requiring a requests.Response object.

Parameters:
responserequests.Response

The response from the original request.

property status: str

The status code of the API response.

Returns:
str

The status code of the API response.

Type:

str

property resultinfo: dict

The pagination information in the API response.

Returns:
dict

The pagination information in the API response.

Type:

dict

property message: str

The status message in the API response.

Returns:
str

The status message in the API response.

Type:

str

property data: dict | list[dict]

The data in the API response.

Returns:
str

The data in the API response - will usually be either a dict or a list of dicts.

Type:

dict or list

class financial_services_register_api.api.FinancialServicesRegisterApiSession(api_username: str, api_key: str)[source]

A simple requests.Session-based class for an API session.

Attributes

api_key

The API key (obtained from the API developer portal profile).

api_username

The API username (signup email for the Financial Services Register).

Examples

>>> import os
>>> session = FinancialServicesRegisterApiSession(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> type(session)
<class 'api.FinancialServicesRegisterApiSession'>
>>> assert session.api_username == os.environ['API_USERNAME']
>>> assert session.api_key == os.environ['API_KEY']
>>> assert session.headers == {'ACCEPT': 'application/json', 'X-AUTH-EMAIL': os.environ['API_USERNAME'], 'X-AUTH-KEY': os.environ['API_KEY']}
__init__(api_username: str, api_key: str) None[source]

Initialiser requiring the API username and key.

Parameters:
api_usernamestr

The API username which will be the email used to sign up on the API developer portal:

https://register.fca.org.uk/Developer/s/

api_keystr

The API key obtained from the registration profile on the API developer portal.

Examples

>>> import os
>>> session = FinancialServicesRegisterApiSession(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> assert session.api_username == os.environ['API_USERNAME']
>>> assert session.api_key == os.environ['API_KEY']
>>> assert session.headers == {'ACCEPT': 'application/json', 'X-AUTH-EMAIL': os.environ['API_USERNAME'], 'X-AUTH-KEY': os.environ['API_KEY']}
property api_username: str

The API username (signup email for the Financial Services Register).

Returns:
str

The API username.

Examples

>>> import os
>>> session = FinancialServicesRegisterApiSession(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> assert session.api_username == os.environ['API_USERNAME']
Type:

str

property api_key: str

The API key (obtained from the API developer portal profile).

Returns:
str

The API key.

Examples

>>> import os
>>> session = FinancialServicesRegisterApiSession(os.environ['API_USERNAME'], os.environ['API_KEY'])
>>> assert session.api_key == os.environ['API_KEY']
Type:

str