WebPagetest Forums

Full Version: How to determine valid locations for the REST api?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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.
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?p...&private=1

With a valid key works, however,

http://www.webpagetest.org/runtest.php?p...&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?
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"
  }
}
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.
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
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
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.
(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.
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?
Reference URL's