How to write jsonPath for this API endpoint?

For the date field, I have used $[“Technical Analysis: RSI”]*. But it is capturing everything around the date text fields. How to only capture the dates written in the YYYY-MM-dd format?

Try $[“Technical Analysis: RSI”]*~ (note the tilde at the end).

1 Like

Still not working, it is skipping the date fields altogether -

Sorry, typo (copied from your initial message): $[“Technical Analysis: RSI”].*~ .

You can use https://jsonpath.com/ for quickly testing JSON paths.

1 Like

I am afraid the same issue -

I have uploaded the json content here - { "Meta Data": { "1: Symbol": "SPY", "2: Indicator": "Rel - Pastebin.com

1 Like

Is converting from json to xml an option and grab it via xpath?

@MartinDDDD I find json to be much better and error-free option and would like to stay with it :slight_smile:

I have added the json content in my previous reply.

1 Like

Hi @tone_n_tune ,

You can try this method. The date appears in the “json path”, so you need to select to take the “json path” string instead of its value.

json_path.knwf (60.8 KB)

PS:KNIME 5.2.5

3 Likes

@tomljh Since Regex is being used in your solution, can not the usual jsonPath node with Regex option be used?

Did you run the node with the JSON path suggestion from above or are you only judging from the dialog that it won’t work. Because the JSON path is correct and does what you want:

1 Like

Yes, I did. Please have a look at this screenshot, I am not getting anything returned:

It seems you are using strange quote characters around “Technical Analysis: RSI” in the JSON path expression. Try using single quotes.

I have used the same jsonPath with single quotes in KNIME 5.3.1, but it is still not working.

Perhaps KNIME’s internal json spec still does not support that pattern with ~ (tilde)?

As shown in the figure

Regular expressions are only used to quickly retrieve dates

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.