Get ID from username? | API Development | TORN
Get ID from username?
  • |X| Carl [1188181]Carl [1188181]
    • Carl [1188181]
    • Role: Civilian
    • Level: 100
    • Posts: 1240
    • Karma: 1642
    • Last Action: 2 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Thread created on 10:37:50 - 20/09/21 (1 month ago)
    |
    Last replied 13:19:23 - 11/10/21 (11 days ago)
    Hi,

    I cant see anything on the docs or from the forum search, but is there a way to find out a userid from a username? so I could query for 'Carl' and it would return 1188181..

    thanks
  • DAM DeKleineKobini [2114440]DeKleineKobini [2114440]
    • DeKleineKobini [2114440]
    • Role: Committee
    • Level: 93
    • Posts: 2655
    • Karma: 3598
    • Last Action: 4 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 10:58:24 - 20/09/21 (1 month ago)
    Post link copied to clipboard Copy post link
    You can't, you'd need to through all ids.

    Trading | Spreadsheets | Free Scripts | Paid Scripts

    Creating personalized trading spreadsheets and spreadsheets for other purposes, check my forum thread for more information.

    Buying many items, check my spreadsheet for the items I buy with up-to-date prices.

    competition.php?c=EasterEggs&step=eggImage&access_token=nothanks

  • TWI LouBaker [1162207]LouBaker [1162207]
    • LouBaker [1162207]
    • Role: Civilian
    • Level: 100
    • Posts: 2351
    • Karma: 1483
    • Last Action: 47 minutes
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:27:11 - 29/09/21 (23 days ago)
    Post link copied to clipboard Copy post link
    there is a little trick on browsers using NID=Player Name, but everything in the APIs uses player IDs

    https://www.torn.com/profiles.php?NID=LouBaker
    Last edited by LouBaker on 12:28:57 - 29/09/21

    Torn's Frequent Flyers          Faction Upgrades SIM           Parcels With Messages        

  • JFK™ Kivou [2000607]Kivou [2000607]
    • Kivou [2000607]
    • Role: Reporter
    • Level: 100
    • Posts: 1599
    • Karma: 2217
    • Last Action: 3 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:28:50 - 02/10/21 (20 days ago)
    Post link copied to clipboard Copy post link

    LouBaker [1162207]

    there is a little trick on browsers using NID=Player Name, but everything in the APIs uses player IDs

    https://www.torn.com/profiles.php?NID=LouBaker

    FJK

  •   Father [2131687]Father [2131687]
    • Father [2131687]
    • Role: Civilian
    • Level: 81
    • Posts: 1219
    • Karma: 3700
    • Last Action: 41 minutes
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:37:27 - 02/10/21 (20 days ago)
    Post link copied to clipboard Copy post link

    LouBaker [1162207]

    there is a little trick on browsers using NID=Player Name, but everything in the APIs uses player IDs

    https://www.torn.com/profiles.php?NID=LouBaker

    Kivou [2000607]

    If you examine the heart icon on your sidebar or on someone's profile, you will notice that the link there is also of this kind.
  • TWI LouBaker [1162207]LouBaker [1162207]
    • LouBaker [1162207]
    • Role: Civilian
    • Level: 100
    • Posts: 2351
    • Karma: 1483
    • Last Action: 47 minutes
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:34:45 - 02/10/21 (20 days ago)
    Post link copied to clipboard Copy post link

    LouBaker [1162207]

    there is a little trick on browsers using NID=Player Name, but everything in the APIs uses player IDs

    https://www.torn.com/profiles.php?NID=LouBaker

    Kivou [2000607]

    Father [2131687]

    If you examine the heart icon on your sidebar or on someone's profile, you will notice that the link there is also of this kind.

    Torn's Frequent Flyers          Faction Upgrades SIM           Parcels With Messages        

  • TWI LouBaker [1162207]LouBaker [1162207]
    • LouBaker [1162207]
    • Role: Civilian
    • Level: 100
    • Posts: 2351
    • Karma: 1483
    • Last Action: 47 minutes
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:42:04 - 02/10/21 (20 days ago)
    Post link copied to clipboard Copy post link
    It's really useful now I think about it, I don't do scripts so it has never been of any use to me

    I used it in IRC a lot to ID members we didn't have Discord back then

    But for you guys it really is, I can think of a lot of ideas I'm sure you can
    Last edited by LouBaker on 23:16:40 - 02/10/21

    Torn's Frequent Flyers          Faction Upgrades SIM           Parcels With Messages        

  • JFK™ Kivou [2000607]Kivou [2000607]
    • Kivou [2000607]
    • Role: Reporter
    • Level: 100
    • Posts: 1599
    • Karma: 2217
    • Last Action: 3 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 05:24:19 - 03/10/21 (19 days ago)
    Post link copied to clipboard Copy post link

    Carl [1188181]

    Hi,

    I cant see anything on the docs or from the forum search, but is there a way to find out a userid from a username? so I could query for 'Carl' and it would return 1188181..

    thanks
    That might be worth posting a suggestion for the API but you might want to explain why to you need it (like how do you end up with just a name and no ID).


    I was looking for such feature for discord bots to match name and ID in a single call. But now that you can request by torn or discord ID it's useless.


    Also you can look at torn stats API which allows for a name lookup. Tho this is not bulletproof.

    FJK

  • TWI LouBaker [1162207]LouBaker [1162207]
    • LouBaker [1162207]
    • Role: Civilian
    • Level: 100
    • Posts: 2351
    • Karma: 1483
    • Last Action: 47 minutes
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 10:48:05 - 03/10/21 (19 days ago)
    Post link copied to clipboard Copy post link
    I use the NIDs in forums where player names are posted without links
    my app detects copy with shift and calls the NID link to view their profiles
    the race track gave the idea

    Torn's Frequent Flyers          Faction Upgrades SIM           Parcels With Messages        

  • Nest kotek [2335167]kotek [2335167]
    • kotek [2335167]
    • Role: Civilian
    • Level: 60
    • Posts: 43
    • Karma: 40
    • Last Action: 1 hour
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 09:47:57 - 10/10/21 (12 days ago)
    Post link copied to clipboard Copy post link
    I mean... You can scrape all usernames with legitimate API calls in like 3 weeks and then just keep a local JSON for your scripts.
  • CR Untouchable [1360035]Untouchable [1360035]
    • Untouchable [1360035]
    • Role: Committee
    • Level: 100
    • Posts: 4698
    • Karma: 5707
    • Last Action: 1 hour
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:19:23 - 11/10/21 (11 days ago)
    Post link copied to clipboard Copy post link

    kotek [2335167]

    I mean... You can scrape all usernames with legitimate API calls in like 3 weeks and then just keep a local JSON for your scripts.
    Or ask CRLF, she gave me a DB dump of all player names & their IDs :)

    4th best GAK in the game for sale! $40b obo

Reply
Thread Title: