#1 Posted by drew (126 posts) -

Hey duders, 
I'm trying do a lookup on the API using only the data I can glean from the URL itself. Take, for example, Mario's page: 
http://www.giantbomb.com/mario/94-177/  
 From what I can tell, the word "mario" is ignored and is just there to make the URL human-readable. Instead, Giant Bomb seems to use the numbers (94-177) to resolve the resource and forward to its page. Now, all of the characters I've looked up start with "94-" so I assume "94" stands for character. If you look up /character/177 in the API, it returns Mario's details so 177 must be Mario's ID. 
Now, my question is, is there a more straightforward way of finding an object based on its URL? Or do I need to figure out the ID for each object type and store those in my application for making requests?
Thanks, 
 Drew

#2 Edited by LordAndrew (14424 posts) -

That's about it. The number before the hyphen indicates the page type, and the number after the hyphen is the ID of the page. Here's something I threw together in December. It doesn't give any information with regard to the API, but you can easily get that from the API documentation
 

 Giant Bomb

NamePluralized nameIDLinkAdditional notes
GameGames61/games/ 
FranchiseFranchises62/franchises/ 
CharacterCharacters94/characters/ 
PlatformPlatforms60/platforms/ 
PersonPeople72/person/ 
CompanyCompanies65/company/ 
ObjectObjects93/things/ 
ConceptConcepts92/concepts/ 
LocationLocations95/locations/ 
AccessoryAccessories59/accessory/ 
ReviewReviews141/reviews/ID is not normally seen
User reviewUser reviews31/user_reviews/ID for individual user reviews is seen, but not type ID
VideoVideos17/videos/ 
ReleaseReleases63none

ID for individual releases can be seen in some areas, but not the type ID
Releases cannot be viewed individually, but grouped together with other releases for a game

Rating boardRating boards56none

USK rating board and associated ratings are unused
Rating board and rating pages are associated with releases and cannot be viewed individually

Game ratingGame ratings77noneUSK rating board and associated ratings are unused
Rating board and rating pages are associated with releases and cannot be viewed individually
RegionRegions58noneIndividual regions cannot be viewed
GenreGenres64none 
ThemeThemes150none 
 
#3 Posted by drew (126 posts) -
@LordAndrew: Ah, that's awesome. Thanks very much for passing that on.
#4 Posted by LordAndrew (14424 posts) -
@drew: Glad to help. I didn't expect that would ever actually be of use to anyone. :)