API endpoints recently started failing

(Chris Labombard) #1

I have been using pricing/sku and pricing/buy/sku for many months. Every night I update my prices in batches of 100. A couple of nights ago my endpoint calls started mostly failing (some still succeed but the majority fail)

Endpoints are returning {“size”:0,“timeout”:0}



It is possible this is due to some code change I made but I do not see it and I couldn’t find any relevant changes in my svn logs. The endpoint calls don’t look incorrect to me.

Has something changed in the TCGPlayer API?? Am I doing something wrong?

Any help would be much appreciated.

(Ben) #2

I noticed the same issue on my end, and am basically using the same method, but using the productID fetch; scraping prices 100 at a time. I tested some lines individually for where the errors occurred and noticed sometimes I get a bad request and sometimes it runs fine, so it seems like something on TCG’s end that is not working.

EX: http://api.tcgplayer.com/pricing/product/2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612

Any insight would be appreciated, thanks.


(Chris Labombard) #3

@BennyBoy25172 - I could be wrong but your request appears to be missing the version code …


(Chris Labombard) #4

I’ve tried updating to the most recent api


The endpoint still intermittently returns {“size”:0,“timeout”:0}

(Chris Labombard) #5

I figured out I didn’t know how response.json and the Reponse body works. So after fixing my ignorance I got this reduced to the core problem (as Benny found).

status 400
statusText Bad Request

FetchError: invalid json response body “URL” reason: Unexpected token < in JSON at position 0

I found there is a 2000 character limit at this thread

My request is only 795 characters. I thought maybe it could be the tcg response is too large so I reduced my requests from 100 to 10 and so far it is running smoothly, without error…

I have a time estimator in my price gatherer.

Batches of 100 only took 150-180 minutes to complete … (3 hours)

Batches of 10 will take ~1100 minutes to complete all batches. (18 hours)
I tried batches of 25. It works but will take ~550-600 minutes to complete all batches. (10 hours)
I tried batches of 50 and get the same BAD REQUEST the majority of the time.

This worked perfectly fine a week or so ago… Something must have changed when the TCGPlayer devs were prepping to deprecate the old API levels.

Is there any way it can be restored to work with larger requests again?

(Ben) #6

Thanks, that fixed it for me.

I didn’t think that was the issue initially, because like you, my URL had been working fine until a week ago, but I guess that was my issue.