WebPagetest Forums
How to determine valid locations for the REST api? - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: General Discussion (/forumdisplay.php?fid=25)
+--- Thread: How to determine valid locations for the REST api? (/showthread.php?tid=13664)



How to determine valid locations for the REST api? - johnbburg - 04-10-2015 04:43 AM

I am working on a script that runs a suite of performance tests against a site and I am utilizing the batch tool available in the WPO Foundation's repository.

My question is how do I determine what are valid test locations to use with the REST API? I've found this page referenced in the location information documentation, but none of the location strings listed here seem to work. The only one I do know that works is "Dulles 5Mbps Cable" and that isn't listed in the link I provided. I am looking to test with locations using iOS, chrome on windows and IE11.


RE: How to determine valid locations for the REST api? - andydavies - 04-11-2015 01:19 AM

Ok, for starters…

Have you already got an API key? If not you can get one here - http://www.webpagetest.org/getkey.php

http://www.webpagetest.org/getLocations.php will give you the list of locations you can use so for example this is IE11 on EC2 in Virgina [bold]ec2-us-east-1:IE 11[/bold] - you'll need to make sure the location is URL encoded when passed over HTTP

Swap IE 11 for Chrome or Firefox is you want a different browser, if you want to use something other than cable add .DSL, or .custom on the end of the location. If you choose a custom setting you'll need to specificy the up/down/latency/plr settings in the API call too.


RE: How to determine valid locations for the REST api? - johnbburg - 04-11-2015 06:12 AM

I have an API key. I saw that locations page you mention and have been attempting to use some of the references it makes, but not all of them work. For example:

http://www.webpagetest.org/runtest.php?priority=6&runs=2&mv=1&video=0&location=Dulles_IE11.Cable&f=xml&url=http%3A%2F%2Fwww.my-site.org%2F&fvonly=1&k=XXXXXXXXXXXXX&private=1

With a valid key works, however,

http://www.webpagetest.org/runtest.php?priority=6&runs=2&mv=1&video=0&location=Dulles_Chrome.Cable&f=xml&url=http%3A%2F%2Fwww.my-site.org%2F&fvonly=1&k=XXXXXXXXXXXXX&private=1

Does not. Also Dulles_iOS does not work either (or the variation IOS). Both respond with the error message "Invalid Location, please try submitting your test request again.". Do I need to specify the up/down/latency/plr settings in the call if I change the browser as well?


RE: How to determine valid locations for the REST api? - andydavies - 04-12-2015 09:15 PM

I think the first one that fails for you is due to the location being incorrect

Code:
http://www.webpagetest.org/runtest.php?priority=6&runs=2&mv=1&video=0&location=Dulles_Chrome.Cable&f=xml&url=http%3A%2F%2Fwww.my-site.org%2F&fvonly=1&k=XXXXXXXXXXXXX&private=1

The location should be: Dulles:Chrome.Cable - note the colon not underscore between location and browser

Dulles_iOS works as a location for me…

This request:

Code:
http://www.webpagetest.org/runtest.php?f=json&url=http://www.bbc.co.uk/news/&k=api-key&location=Dulles_iOS

Gives this response:

Code:
{
  "statusCode": 200,
  "statusText": "Ok",
  "data": {
  "testId": "150412_M6_F3F",
  "ownerKey": "xxxxxx",
  "jsonUrl": "http:\/\/www.webpagetest.org\/jsonResult.php?test=150412_M6_F3F",
  "xmlUrl": "http:\/\/www.webpagetest.org\/xmlResult\/150412_M6_F3F\/",
  "userUrl": "http:\/\/www.webpagetest.org\/result\/150412_M6_F3F\/",
  "summaryCSV": "http:\/\/www.webpagetest.org\/result\/150412_M6_F3F\/page_data.csv",
  "detailCSV": "http:\/\/www.webpagetest.org\/result\/150412_M6_F3F\/requests.csv"
  }
}



RE: How to determine valid locations for the REST api? - johnbburg - 04-16-2015 12:00 AM

Do locations change often? I tried that same url with my key and received the following.

Code:
{
  "statusCode":400,
  "statusText":"Invalid Location, please try submitting your test request again."
}

I could have sworn this was working two days ago.


RE: How to determine valid locations for the REST api? - larsh - 05-03-2015 03:37 AM

Hi,

i tried the ios-Link above also and got a "invalid location". I want to test Nexus 7 (Dulles_Nexus7:Nexus 7 - Chrome.Cable), but it does not work. I got a "invalid location". Other Locations work. Can anybody help?

Regards
Lars


RE: How to determine valid locations for the REST api? - hunj - 05-28-2015 05:19 PM

Hello,

I also am experiencing the same issue as larsh above mentioned, where the location listed in getLocations.php page is not working (giving the "invalid location" message).

This issue definitely should be looked at.

Cheers,
Hunj


RE: How to determine valid locations for the REST api? - pmeenan - 05-29-2015 02:49 PM

Do you have your email that contained the api key? It should have given you a list of locations that were usable with the auto-generated key (and the page for viewing them - http://www.webpagetest.org/getLocations.php?f=html&k=A ). It is a subset of the full list of locations where there is enough capacity to automatically allow API testing.

It should have also mentioned that if you need to test against the full list of locations to contact me and I can manually assign a key with full access.


RE: How to determine valid locations for the REST api? - pandawin - 11-30-2015 12:38 PM

(05-29-2015 02:49 PM)pmeenan Wrote:  Do you have your email that contained the api key? It should have given you a list of locations that were usable with the auto-generated key (and the page for viewing them - http://www.webpagetest.org/getLocations.php?f=html&k=A ). It is a subset of the full list of locations where there is enough capacity to automatically allow API testing.

It should have also mentioned that if you need to test against the full list of locations to contact me and I can manually assign a key with full access.

SmileI have the same problem. How can I test from shanghai,china ?
The location list from "http://www.webpagetest.org/getLocations.php?f=html&k=A" no shanghai,china location.
help me, thanks.


RE: How to determine valid locations for the REST api? - dradicke - 03-12-2019 09:52 PM

This is an old thread, but my question is related:
I have found this php-page for locations:
https://www.webpagetest.org/getLocations.php

But where would I find the possible (mobile) browser and speed values to combine with the location?