Shopping at LEGO or Amazon?
Please use our links: LEGO.comAmazon
As an Amazon Associate we earn from qualifying purchases.

API v3 discussion

2»

Comments

  • benbacardibenbacardi EnglandMember Posts: 700
    @Huw - something I noticed when playing with the API - #21020 is classified as "Architecture" with a subtheme of "Landmark series" whereas all the others in that subtheme are "Landmark Series" - note the case difference of "series" vs "Series"! Here's the JSON:
          "setID": 23406,
          "number": "21020",
          "numberVariant": 1,
          "name": "Trevi Fountain",
          "year": 2014,
          "theme": "Architecture",
          "themeGroup": "Model making",
          "subtheme": "Landmark series",
    vs
          "setID": 6679,
          "number": "21000",
          "numberVariant": 1,
          "name": "Sears Tower",
          "year": 2008,
          "theme": "Architecture",
          "themeGroup": "Model making",
          "subtheme": "Landmark Series",
    It doesn't make any material difference, but unless I ignore case when grouping sets (which is easily done!) then the Trevi Fountain gets a group all of its own.
    This doesn't manifest on Brickset itself, so the logic there must be case insensitive. Not sure if it's something you care about fixing?
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    I've edited it.

    SQL server is case-insensitive and we display themes/subthemes etc. in upper case so is not noticeable.
    benbacardi
  • nicmarenicmare BerlinMember Posts: 9
    Played around with 

    getKeyUsageStats

    works good! thank you @Huw ! very helpful!
    Huw
  • nicmarenicmare BerlinMember Posts: 9
    Also increased caching methods on my side. 
  • hantothantot UKMember Posts: 280
    might be a push to move to v3 but has getSets on v2 stopped accepting multiple set numbers? can get single set data back fine but not multiple ones
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    edited May 2020
    ^ Yes it has. I've been simplifying the stored procedure to speed it up.

  • RexfelisRexfelis Snohomish, WAMember Posts: 32
    Any chance of bringing back "getReviews" in the v3 API?
  • RexfelisRexfelis Snohomish, WAMember Posts: 32
    Also, a more obscure one, any chance of adding back parameters to "getThemes" and "getSubthemes" to filter by user(Hash), "owned" and "wanted"? (like the v2 getThemesForUser and getSubthemesForUser)
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    edited May 2020
    They were not used, and I think the v2 versions have been disabled.

    I'm reluctant to add every feature to the API: its purpose is not to facilitate the production of something that negates the need to visit the website, but to supplement it and encourage visiting/registering.
    RikTheVeggie
  • RexfelisRexfelis Snohomish, WAMember Posts: 32
    A bit disappointed, but I understand your reasoning.

    If I ever get my app close to release, maybe we can figure out some ways to drive some income to the website while still providing a native app experience (and make it more worthwhile to invest in the API).
  • RexfelisRexfelis Snohomish, WAMember Posts: 32
    Uhhhh. I think I broke something?



    I was updating my app to use the v3 API and was at the point of updating/validating my use of setCollection when I noticed that I was getting duplicate results in my getSets response. At first I thought is was just a bug on my app, but decided to check the website as well and this is what showed up...

    Or is it maybe some weird local caching thing for me?
  • RexfelisRexfelis Snohomish, WAMember Posts: 32
    For the record, it seemed to be working fine when I was still (mistakenly, I thought) sending the parameters in the POST body (as JSON)...it didn't seem to go wonky until I updated to pass the parameters in the query string instead of the post body.
  • RexfelisRexfelis Snohomish, WAMember Posts: 32
    Okay, odd. It seems to have fixed itself now that I was able to make a successful setCollection update using the API test page.

    Apparently maybe I'm just doing it a bit wrong. Anyhow, seems to be mostly working now. So now the only problem I'm having is that I can't send an empty string for "notes". 
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    The notes issue is a known bug: I suggest sending a single space until I resolve it!
  • seb303seb303 UKMember Posts: 2
    For part of my application, the user can save groups of sets.  I would like to be able to retrieve all the set data with a single call to getSets, passing multiple setIDs.  From the API docs this doesn't seem possible.  Is there a way to pass a list of setIDs as criteria to getSets?  e.g. as a JSON array rather than a single integer?



  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    Not currently but it's a good idea...
  • seb303seb303 UKMember Posts: 2
    edited June 2020
    So currently I'll have to call getSets multiple times.  I will implement this for now, but will change over to using a single call once it's possible.
    Thank you.
  • LebosteinLebostein GermanyMember Posts: 48
    edited August 2020
    On the set site I see the UVP for France:

    But if I use the API I don't get this information:

        "LEGOCom": {
          "US": {
            "retailPrice": 99.99,
            "dateFirstAvailable": "2020-07-03T00:00:00Z"
          },
          "UK": {
            "retailPrice": 89.99,
            "dateFirstAvailable": "2020-07-01T00:00:00Z",
            "dateLastAvailable": "2020-07-03T00:00:00Z"
          },
          "CA": {
            "retailPrice": 149.99,
            "dateFirstAvailable": "2020-07-01T00:00:00Z"
          },
          "DE": {
            "retailPrice": 97.47,
            "dateFirstAvailable": "2020-07-02T00:00:00Z",
            "dateLastAvailable": "2020-07-04T00:00:00Z"
          }
        }

    Why?

  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    FR is not currently exposed via the API. Neither is NL, FI, SE, DK, NO etc. etc. 

    Although the price will be different the dates will be the same.
  • benbacardibenbacardi EnglandMember Posts: 700
    Out of curiosity, which field are searched when you pass a "query" to getSets? I presume it's a case-insensitive "contains" query against number and name, not anything more complex?
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    Number, name, theme and subtheme.

    benbacardi
  • LebosteinLebostein GermanyMember Posts: 48
    Huw said:
    FR is not currently exposed via the API. Neither is NL, FI, SE, DK, NO etc. etc. 

    Although the price will be different the dates will be the same.

    Is there a reason for that? I thought the web page and the API are based on the same database?

  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,867
    I guess I don't want to give all my hard-earned data away ;)
  • louislllouisll USMember Posts: 1
    Hi! Thank you for providing all the LEGO data! It's super helpful. Currently, I am using the API for a student web application project. I found there is a limit of API call for getSet, could someone help me to increase the API call limit? Thank you! @Huw
Sign In or Register to comment.

Shopping at LEGO.com or Amazon?

Please use our links: LEGO.com Amazon

Recent discussions Categories Privacy Policy Brickset.com

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Brickset.com is a participant in the Amazon Services LLC Associates Program, the Amazon.com.ca, Inc. Associates Program and the Amazon EU Associates Programme, which are affiliate advertising programs designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.

As an Amazon Associate we earn from qualifying purchases.