Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search quote API #4

Open
odrail opened this issue Dec 7, 2024 · 0 comments · May be fixed by #5
Open

Search quote API #4

odrail opened this issue Dec 7, 2024 · 0 comments · May be fixed by #5
Labels
enhancement New feature or request
Milestone

Comments

@odrail
Copy link
Owner

odrail commented Dec 7, 2024

As mapping.js was removed in v.5.0.0, is needed to retrieve a valid pairId without accessing to investing.com.

The new API will be:

import { searchQuotes } from 'investing-com-api'

const searchString = 'SWDA' // a string to search (required)
const options = { // optional
  filter: {
    type: 'ETF',
     exchanges: ['Switzerland', 'Milan', 'London']
  }
}
const quotes = await searchQuotes(searchString, options)

The API return an array like this:

[
        {
            "pairId": 995448,
            "url": "/etfs/ishares-msci-world---acc?cid=995448",
            "description": "iShares Core MSCI World UCITS ETF USD (Acc)",
            "symbol": "SWDA",
            "exchange": "Switzerland",
            "flag": "Switzerland",
            "type": "ETF - Switzerland"
        },
        {
            "pairId": 995447,
            "url": "/etfs/ishares-msci-world---acc?cid=995447",
            "description": "iShares Core MSCI World UCITS ETF USD (Acc)",
            "symbol": "SWDA",
            "exchange": "London",
            "flag": "UK",
            "type": "ETF - London"
        },
        {
            "pairId": 46925,
            "url": "/etfs/ishares-msci-world---acc?cid=46925",
            "description": "iShares Core MSCI World UCITS ETF USD (Acc)",
            "symbol": "SWDA",
            "exchange": "Milan",
            "flag": "Italy",
            "type": "ETF - Milan"
        }
    ]
@odrail odrail added this to the v5.1.0 milestone Dec 7, 2024
@odrail odrail added the enhancement New feature or request label Dec 7, 2024
odrail pushed a commit that referenced this issue Dec 7, 2024
@odrail odrail linked a pull request Dec 7, 2024 that will close this issue
odrail pushed a commit that referenced this issue Dec 7, 2024
odrail pushed a commit that referenced this issue Dec 7, 2024
odrail pushed a commit that referenced this issue Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant