Git Product home page Git Product logo

Comments (9)

Chavithra avatar Chavithra commented on July 28, 2024

Hi,

Issue
I can indeed reproduce this issue.

When I send this RequestOptions :

ProductSearch.RequestOptions(
    inputAggregateTypes='',
    inputAggregateValues='',
    optionExchangeId=1,
    underlyingIsin='GB00B03MLX29',
    searchText='',
    offset=0,
    limit=100,
    requireTotal=True,
    sortColumns='name',
    sortTypes='asc',
)

I have the following response :

  • status code : 400
  • body : {'errors': [{'text': 'No corresponding model found'}]}

Fix
I saw that sorting was done on the following fields for Options :

  • expirationDate
  • strike

I have figured that out comparing the RequestOptions and the URL you have provided.

It seems to work, when you empty the sortColumns attribute like this :

    sortColumns='',

That probably means we can't sort on the name field for Options.

I have updated the documentation accordingly.

Question
Does that work on your side too ?

Thanks for reporting this bug.

from degiro-connector.

fbondeaux avatar fbondeaux commented on July 28, 2024

@Chavithra Thanks; I will check in a few hours!

from degiro-connector.

fbondeaux avatar fbondeaux commented on July 28, 2024

Result after the request:
DEBUG:urllib3.connectionpool:https://trader.degiro.nl:443 "GET /product_search/secure/v5/options?optionExchangeId=1&underlyingIsin=GB00B03MLX29&limit=100&requireTotal=True&sortColumns=expirationDate%2Cstrike&sortTypes=asc%2Casc&intAccount=0&sessionId=6FAEA8C3D2A26CE38DB38EBE4F.prod_a_113_2 HTTP/1.1" 404 None

https://trader.degiro.nl/trader/#/products?productType=8&exchange=1&underlying=NL0000000107&strikeType=-1&optionType=-1&month=-1&year=-1&sortColumns=expirationDate%2Cstrike&sortTypes=asc%2Casc§

The terminal link seems different

from degiro-connector.

Chavithra avatar Chavithra commented on July 28, 2024

I can see you have put :

int_account=0

When I set the wrong int_account I also have an error 404.

That might be the source of this last error.

from degiro-connector.

Chavithra avatar Chavithra commented on July 28, 2024

I am closing this ticket since there are no more valid bugs reported.

from degiro-connector.

fbondeaux avatar fbondeaux commented on July 28, 2024

@Chavithra Sorry for my late response. It does work indeed now thank you!

I have another Q: is there a shortcut with converting the output of:
option_list = trading_api.product_search(request=request, raw=False)
or
product = option_list.products[0]
directly into dict or list? The output is now pb extension and it takes a lot of operation to have something meaningful.

Thanks and nice job!

from degiro-connector.

fbondeaux avatar fbondeaux commented on July 28, 2024

I'll leave this package here:
https://github.com/kaporzhu/protobuf-to-dict

from degiro-connector.

Chavithra avatar Chavithra commented on July 28, 2024

Hello,

here are two solutions to convert message to dict.

Solution 1
To get the result as a dict you can use the parameter raw, like this :

option_list = trading_api.product_search(request=request, raw=True)

Solution 2
You can also use the helper method called message_to_dict, here is an example:

import quotecast.helpers.pb_handler as pb_handler
pb_handler.message_to_dict(message=option_list)

from degiro-connector.

fbondeaux avatar fbondeaux commented on July 28, 2024

Sweet man; much appreciated

from degiro-connector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.