diff --git a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts index 3b0d8ba72..1cdfbd0e0 100644 --- a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts +++ b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts @@ -438,6 +438,7 @@ export class FinancialModelingPrepService implements DataProviderInterface { } public async search({ + includeIndices = false, query, requestTimeout = this.configurationService.get('REQUEST_TIMEOUT') }: GetSearchParams): Promise { @@ -484,17 +485,25 @@ export class FinancialModelingPrepService implements DataProviderInterface { } ).then((res) => res.json()); - items = result.map(({ currency, name, symbol }) => { - return { - currency, - symbol, - assetClass: undefined, // TODO - assetSubClass: undefined, // TODO - dataProviderInfo: this.getDataProviderInfo(), - dataSource: this.getName(), - name: this.formatName({ name }) - }; - }); + items = result + .filter(({ symbol }) => { + if (includeIndices === false && symbol.startsWith('^')) { + return false; + } + + return true; + }) + .map(({ currency, name, symbol }) => { + return { + currency, + symbol, + assetClass: undefined, // TODO + assetSubClass: undefined, // TODO + dataProviderInfo: this.getDataProviderInfo(), + dataSource: this.getName(), + name: this.formatName({ name }) + }; + }); } } catch (error) { let message = error;