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

Optional Fund Profit Comparison Endpoint Support #20

Open
okankonur opened this issue Jan 17, 2024 · 2 comments
Open

Optional Fund Profit Comparison Endpoint Support #20

okankonur opened this issue Jan 17, 2024 · 2 comments

Comments

@okankonur
Copy link

okankonur commented Jan 17, 2024

Hi, maybe support for fund returns comparison page can be added.

Post data sample:

        url=f"https://fundturkey.com.tr/api/DB/BindComparisonFundReturns",
        data= {
            "calismatipi": 1,
            "fontip": "YAT",
            "bastarih": "14.01.2024",
            "bittarih": "16.01.2024",
            "islemdurum": 1  
        }

Response sample:

    {
        "FONKODU": "YUN",
        "FONUNVAN": "YAPI KRED\u0130 PORTF\u00d6Y \u0130ST\u0130NYE SERBEST (D\u00d6V\u0130Z) FON",
        "FONTURACIKLAMA": "Hedge Umbrella Fund",
        "GETIRIORANI": 0.2569
    },
    {
        "FONKODU": "YZK",
        "FONUNVAN": "YAPI KRED\u0130 PORTF\u00d6Y KALAMI\u015e SERBEST FON",
        "FONTURACIKLAMA": "Hedge Umbrella Fund",
        "GETIRIORANI": 0.0964
    }

OR

        url=f"https://fundturkey.com.tr/api/DB/BindComparisonFundReturns",
        data= {
            "calismatipi": 2,
            "fontip": "YAT",
            "strperiod": "1,1,0,1,1,0,0",
            "islemdurum": 1
        }
    {
        "FONKODU": "YJH",
        "FONUNVAN": "YAPI KRED\u0130 PORTF\u00d6Y TEM\u0130Z ENERJ\u0130 DE\u011e\u0130\u015eKEN FONU",
        "FONTURACIKLAMA": "Variable Umbrella Fund",
        "GETIRI1A": -2.2096,
        "GETIRI3A": 10.8607,
        "GETIRI6A": null,
        "GETIRI1Y": 19.2132,
        "GETIRIYB": -5.4741,
        "GETIRI3Y": null,
        "GETIRI5Y": null
    },
    {
        "FONKODU": "YPV",
        "FONUNVAN": "YAPI KRED\u0130 PORTF\u00d6Y \u00dc\u00c7\u00dcNC\u00dc FON SEPET\u0130 FONU",
        "FONTURACIKLAMA": "Fund Of Funds Umbrella Fund",
        "GETIRI1A": 0.7878,
        "GETIRI3A": 10.2034,
        "GETIRI6A": null,
        "GETIRI1Y": 53.4969,
        "GETIRIYB": 2.6137,
        "GETIRI3Y": null,
        "GETIRI5Y": null
    }

islemdurum denotes if the fund is traded in Tefas. Also I would really appreciate if there was a way to make the same distinction for the historical data endpoint.

@burakyilmaz321
Copy link
Owner

Thanks for the idea 👍

I was thinking about this recently. I have some sketches on how to design this as a user friendly way.

I think there should be two things:

  1. A method for getting the returns between two days.
  2. A method for getting GETIRI1A, GETIRI3A, etc, for any given date.

Can you pass a date to this:

        url=f"https://fundturkey.com.tr/api/DB/BindComparisonFundReturns",
        data= {
            "calismatipi": 2,
            "fontip": "YAT",
            "strperiod": "1,1,0,1,1,0,0",
            "islemdurum": 1
        }

@okankonur
Copy link
Author

Thanks for the response. As far as I tested, no. If you want to get returns for a given date range you use calismatipi=1 and it returns single GETIRIORANI value like the first example in the original post.
If you want the returns for 1A, 3A, etc. you use calismatipi=2. Passing any date parameter like bastarih or bittarih does not seem to change the results. It calculates according to the current date.

I agree with you on the user friendly way. I think it would be cleaner to have this functionality with other fetch methods available to end user for choosing between given date or default periods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants