make a fully ledged website and scraper for roblox. For the friends API so we can make a…
- User
make a fully ledged website and scraper for roblox. For the friends API so we can make a highly advanced : Are you friends with David Baszucki / any player basically 2020+
In rust.
Use documentation from the friends API roblox
friends.roblox.com{ "swagger": "2.0", "info": { "title": "Friends Api v1", "version": "v1" }, "host": "friends.roblox.com", "schemes": [ "https" ], "paths": { "/v1/metadata": { "get": { "tags": [ "Friends" ], "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "query", "name": "targetUserId", "type": "integer", "format": "int64", "default": 0 } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.FriendsPageMetadataResponse" } } }, "properties": { "internal": false, "metricIds": [ "Friends:GetMetadata" ] } } }, "/v1/my/friends/count": { "get": { "tags": [ "Friends" ], "summary": "Get the number of friends a user has", "produces": [ "application/json", "text/json" ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.FriendsCountResponse" } }, "401": { "description": "0: Authorization has been denied for this request." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetFriendsCount" ] } } }, "/v1/my/friends/requests": { "get": { "tags": [ "Friends" ], "summary": "Get all users that friend requests with targetUserId using exclusive start paging", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "query", "name": "limit", "description": "The number of results per request.", "type": "integer", "format": "int32", "default": 10, "enum": [ 10, 18, 25, 50, 100 ] }, { "in": "query", "name": "cursor", "description": "The paging cursor for the previous or next page.", "type": "string" }, { "in": "query", "name": "sortOrder", "description": "Sorted by scoring requests based on request time, mutual friends, and request origin", "type": "string", "default": "Desc", "enum": [ "Asc", "Desc" ] } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.Models.ApiPageResponse[Roblox.Friends.Api.FriendRequestResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "2: The user is banned from performing operation.\r\n3: The user is blocked from performing this action." }, "429": { "description": "9: The flood limit has been exceeded." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetFriendRequests" ] } } }, "/v1/user/friend-requests/count": { "get": { "tags": [ "Friends" ], "summary": "Return the number of pending friend requests.", "produces": [ "application/json", "text/json" ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.PendingFriendRequestCountModel" } }, "401": { "description": "0: Authorization has been denied for this request." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetPendingFriendRequestCount" ] } } }, "/v1/users/{targetUserId}/followers": { "get": { "tags": [ "Followings" ], "summary": "Get all users that follow user with targetUserId in page response format", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "", "required": true, "type": "integer", "format": "int64" }, { "in": "query", "name": "limit", "description": "The number of results per request.", "type": "integer", "format": "int32", "default": 10, "enum": [ 10, 18, 25, 50, 100 ] }, { "in": "query", "name": "cursor", "description": "The paging cursor for the previous or next page.", "type": "string" }, { "in": "query", "name": "sortOrder", "description": "The order the results are sorted in.", "type": "string", "default": "Asc", "enum": [ "Asc", "Desc" ] } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.Models.ApiPageResponse[Roblox.Friends.Api.Models.Response.UserResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters." }, "403": { "description": "2: The user is banned from performing operation.\r\n3: The user is blocked from performing this action." }, "429": { "description": "9: The flood limit has been exceeded." } }, "properties": { "internal": false, "metricIds": [ "Followings:GetFollowers" ] } } }, "/v1/users/{targetUserId}/followers/count": { "get": { "tags": [ "Followings" ], "summary": "Get the number of following a user has", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.FollowCountResponse" } }, "400": { "description": "1: The target user is invalid or does not exist." } }, "properties": { "internal": false, "metricIds": [ "Followings:GetFollowersCount" ] } } }, "/v1/users/{targetUserId}/followings": { "get": { "tags": [ "Followings" ], "summary": "Get all users that user with targetUserId is following in page response format", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "", "required": true, "type": "integer", "format": "int64" }, { "in": "query", "name": "limit", "description": "The number of results per request.", "type": "integer", "format": "int32", "default": 10, "enum": [ 10, 18, 25, 50, 100 ] }, { "in": "query", "name": "cursor", "description": "The paging cursor for the previous or next page.", "type": "string" }, { "in": "query", "name": "sortOrder", "description": "The order the results are sorted in.", "type": "string", "default": "Asc", "enum": [ "Asc", "Desc" ] } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.Models.ApiPageResponse[Roblox.Friends.Api.Models.Response.UserResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters." }, "403": { "description": "2: The user is banned from performing operation.\r\n3: The user is blocked from performing this action." }, "429": { "description": "9: The flood limit has been exceeded." } }, "properties": { "internal": false, "metricIds": [ "Followings:GetFollowings" ] } } }, "/v1/users/{targetUserId}/followings/count": { "get": { "tags": [ "Followings" ], "summary": "Get the number of following a user has", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.FollowCountResponse" } }, "400": { "description": "1: The target user is invalid or does not exist." } }, "properties": { "internal": false, "metricIds": [ "Followings:GetFollowingCount" ] } } }, "/v1/users/{userId}/friends": { "get": { "tags": [ "Friends" ], "summary": "Get list of all friends for the specified user.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "description": "The user Id to get the friends for.", "required": true, "type": "integer", "format": "int64" }, { "in": "query", "name": "userSort", "description": "Specifies how to sort the returned friends.", "type": "integer", "format": "int32", "enum": [ 0, 1, 2 ] } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Friends.Api.Models.Response.UserResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetAllFriends" ] } } }, "/v1/users/{userId}/friends/count": { "get": { "tags": [ "Friends" ], "summary": "Get the number of friends a user has", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.FriendsCountResponse" } }, "400": { "description": "1: The target user is invalid or does not exist." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetUsersFriendsCount" ] } } }, "/v1/users/{userId}/friends/find": { "get": { "tags": [ "Friends" ], "summary": "Get a paginated list of all friends for the specified user.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "description": "The user Id to get the friends for.", "required": true, "type": "integer", "format": "int64" }, { "in": "query", "name": "userSort", "description": "Specifies how to sort the returned friends.", "type": "integer", "format": "int32", "default": 2, "enum": [ 0, 1, 2 ] }, { "in": "query", "name": "cursor", "description": "The paging cursor for the previous or next page.", "type": "string" }, { "in": "query", "name": "limit", "description": "The number of results per request.", "type": "integer", "format": "int32", "default": 50 } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Paging.CursoredPagedResult[Roblox.Friends.Api.Models.Response.FriendResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters." }, "401": { "description": "0: Authorization has been denied for this request." } }, "properties": { "internal": false, "metricIds": [ "Friends:FindFriends" ] } } }, "/v1/users/{userId}/friends/inactive": { "get": { "tags": [ "Friends" ], "summary": "Get list of inactive friends for the specified user.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "description": "The user Id to get the friends for.", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Friends.Api.Models.Response.UserResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters." }, "401": { "description": "0: Authorization has been denied for this request." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetInactiveFriends" ] } } }, "/v1/users/{userId}/friends/online": { "get": { "tags": [ "Friends" ], "summary": "Get list of all online friends for the specified user.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "description": "The user Id to get the friends for.", "required": true, "type": "integer", "format": "int64" }, { "in": "query", "name": "userSort", "type": "integer", "format": "int32", "enum": [ 0, 1, 2 ] } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Friends.Api.Models.Response.UserPresenceResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters." }, "401": { "description": "0: Authorization has been denied for this request." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetAllOnlineFriends" ] } } }, "/v1/users/{userId}/friends/search": { "get": { "tags": [ "Friends" ], "summary": "Search for friends by name using a text query.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "description": "The user Id to get the friends for.", "required": true, "type": "integer", "format": "int64" }, { "in": "query", "name": "query", "description": "The string to search names of friends for.", "type": "string" }, { "in": "query", "name": "cursor", "description": "The paging cursor for the previous or next page.", "type": "string" }, { "in": "query", "name": "limit", "description": "The number of results per request.", "type": "integer", "format": "int32", "default": 20 } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Paging.CursoredPagedResult[Roblox.Friends.Api.Models.Response.FriendResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters." }, "401": { "description": "0: Authorization has been denied for this request." } }, "properties": { "internal": false, "metricIds": [ "Friends:SearchFriends" ] } } }, "/v1/users/{userId}/friends/statuses": { "get": { "tags": [ "Friends" ], "summary": "Gets a list of friend statuses of specified users against the specified user.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "description": "The user to check the friend statuses against.", "required": true, "type": "integer", "format": "int64" }, { "in": "query", "name": "userIds", "description": "", "required": true, "type": "array", "items": { "format": "int64", "type": "integer" }, "collectionFormat": "csv" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Friends.Api.FriendStatusResponse]" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n15: Too many ids.\r\n16: Invalid ids." } }, "properties": { "internal": false, "metricIds": [ "Friends:GetFriendStatuses" ] } } }, "/v1/contacts/{targetContactId}/request-friendship": { "post": { "tags": [ "Friends" ], "summary": "Send a contact friend request to target user", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetContactId", "description": "The target contact Id for friend request", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.CaptchaStatusResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n5: The target user is already a friend.\r\n6: Invalid parameters.\r\n7: The user cannot be friends with itself.\r\n31: User with max friends sent friend request." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed\r\n2: The user is banned from performing operation.\r\n3: The user is blocked from performing this action.\r\n14: The user has not passed the captcha." }, "429": { "description": "9: The flood limit has been exceeded." } }, "properties": { "internal": false, "metricIds": [ "Friends:RequestContactFriendship" ] } } }, "/v1/user/{userId}/multiget-are-friends": { "post": { "tags": [ "Friends" ], "summary": "Check if the requesting user is friends with the specified users.", "consumes": [ "application/json", "text/json" ], "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "userId", "description": "The requesting userId.", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "multigetAreFriendsRequestModel", "description": "The user ids to check against with the requesting user.", "required": true, "schema": { "ref": "#/definitions/Roblox.Friends.Api.MultigetAreFriendsRequestModel" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "format": "int64", "type": "integer" } } }, "400": { "description": "1: The target user is invalid or does not exist." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed" } }, "properties": { "internal": false, "metricIds": [ "Friends:MultigetAreFriends" ] } } }, "/v1/user/following-exists": { "post": { "tags": [ "Followings" ], "summary": "Returns whether or not the current user is following each userId in a list of userIds", "consumes": [ "application/json", "text/json" ], "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "body", "name": "requestModel", "description": "The userIds potentially being followed", "required": true, "schema": { "ref": "#/definitions/Roblox.Friends.Api.FollowingExistsRequestModel" } } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.FollowingExistsResponseModel" } }, "400": { "description": "0: An invalid userId was passed in." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed" }, "503": { "description": "1: Followers are disabled at this time." } }, "properties": { "internal": false, "metricIds": [ "Followings:FollowingExists" ] } } }, "/v1/user/friend-requests/decline-all": { "post": { "tags": [ "Friends" ], "summary": "Decline all pending friend requests for the authenticated user.", "produces": [ "application/json", "text/json" ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.DeclineAllFriendRequestsResponse" } }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed" } }, "properties": { "internal": false, "metricIds": [ "Friends:DeclineAllFriendRequests" ] } } }, "/v1/users/{requesterUserId}/accept-friend-request": { "post": { "tags": [ "Friends" ], "summary": "Accept a friend request.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "requesterUserId", "description": "The user Id of the requester", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.ApiEmptyResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n10: The friend request does not exist.\r\n11: The current users friends limit has been exceeded.\r\n12: The target users friends limit has been exceeded." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed\r\n3: The user is blocked from performing this action." } }, "properties": { "internal": false, "metricIds": [ "Friends:AcceptFriendRequest" ] } } }, "/v1/users/{requesterUserId}/decline-friend-request": { "post": { "tags": [ "Friends" ], "summary": "Decline a friend request.", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "requesterUserId", "description": "The user Id of the requester", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.ApiEmptyResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n10: The friend request does not exist." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed" } }, "properties": { "internal": false, "metricIds": [ "Friends:DeclineFriendRequest" ] } } }, "/v1/users/{senderUserId}/accept-friend-request-with-token": { "post": { "tags": [ "Friends" ], "summary": "Accept a friend request with an Off Network Friending token.", "consumes": [ "application/json", "text/json" ], "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "senderUserId", "description": "The user id of the sender of the off network friend request", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "requestModel", "required": true, "schema": { "ref": "#/definitions/Roblox.Friends.Api.Models.Request.FriendingTokenRequestModel" } } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.ApiEmptyResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n3: The user is blocked from performing this action.\r\n5: The target user is already a friend.\r\n6: Invalid parameters.\r\n7: The user cannot be friends with itself.\r\n11: The current users friends limit has been exceeded.\r\n12: The target users friends limit has been exceeded." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed" } }, "properties": { "internal": false, "metricIds": [ "Friends:AcceptFriendRequestWithToken" ] } } }, "/v1/users/{targetUserId}/follow": { "post": { "tags": [ "Followings" ], "summary": "Creates the following between a user and user with targetUserId", "consumes": [ "application/json", "text/json" ], "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "captchaTokenRequest", "description": "", "schema": { "ref": "#/definitions/Roblox.Web.Captcha.Models.Request.CaptchaTokenRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.CaptchaStatusResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters.\r\n8: The user cannot follow itself." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed\r\n2: The user is banned from performing operation.\r\n3: The user is blocked from performing this action.\r\n14: The user has not passed the captcha." }, "429": { "description": "9: The flood limit has been exceeded." } }, "properties": { "internal": false, "metricIds": [ "Followings:FollowUser" ] } } }, "/v1/users/{targetUserId}/request-friendship": { "post": { "tags": [ "Friends" ], "summary": "Send a friend request to target user", "consumes": [ "application/json", "text/json" ], "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "The target user Id for friend request", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "friendshipRequestModel", "description": "The source which the friend request originated from", "required": true, "schema": { "ref": "#/definitions/Roblox.Friends.Api.FriendshipRequestModel" } } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Friends.Api.CaptchaStatusResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n5: The target user is already a friend.\r\n6: Invalid parameters.\r\n7: The user cannot be friends with itself.\r\n10: The friend request does not exist.\r\n13: The users are not in the same game.\r\n31: User with max friends sent friend request.\r\n35: Invalid nickname." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed\r\n2: The user is banned from performing operation.\r\n3: The user is blocked from performing this action.\r\n14: The user has not passed the captcha." }, "429": { "description": "9: The flood limit has been exceeded." } }, "properties": { "internal": false, "metricIds": [ "Friends:RequestFriendship" ] } } }, "/v1/users/{targetUserId}/unfollow": { "post": { "tags": [ "Followings" ], "summary": "Deletes the following between a user and user with targetUserId", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.ApiEmptyResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist.\r\n6: Invalid parameters.\r\n8: The user cannot follow itself." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed\r\n2: The user is banned from performing operation.\r\n3: The user is blocked from performing this action.\r\n14: The user has not passed the captcha." }, "429": { "description": "9: The flood limit has been exceeded." } }, "properties": { "internal": false, "metricIds": [ "Followings:UnFollowUser" ] } } }, "/v1/users/{targetUserId}/unfriend": { "post": { "tags": [ "Friends" ], "summary": "Unfriend a user", "produces": [ "application/json", "text/json" ], "parameters": [ { "in": "path", "name": "targetUserId", "description": "The target user id to unfriend", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "ref": "#/definitions/Roblox.Web.WebAPI.ApiEmptyResponseModel" } }, "400": { "description": "1: The target user is invalid or does not exist." }, "401": { "description": "0: Authorization has been denied for this request." }, "403": { "description": "0: Token Validation Failed" } }, "properties": { "internal": false, "metricIds": [ "Friends:UnFriend" ] } } } }, "definitions": { "Roblox.Friends.Api.CaptchaStatusResponseModel": { "description": "This is response model to notify when action succeeded, failed, or captcha is required", "type": "object", "properties": { "success": { "type": "boolean" }, "isCaptchaRequired": { "description": "Captcha is set to true if captcha is required from user to perform action", "type": "boolean" } } }, "Roblox.Friends.Api.FollowCountResponse": { "description": "Response model for following or followers Count", "type": "object", "properties": { "count": { "format": "int64", "description": "Count of following or followers", "type": "integer" } } }, "Roblox.Friends.Api.FollowingExistsRequestModel": { "description": "Request model for FollowingExists endpoint", "type": "object", "properties": { "targetUserIds": { "description": "The userIds which the user may or may not be following.", "type": "array", "items": { "format": "int64", "type": "integer" } } } }, "Roblox.Friends.Api.FriendRequest": { "description": "A response model representing a friend request.", "type": "object", "properties": { "sentAt": { "format": "date-time", "description": "When the friend request was sent.", "type": "string" }, "senderId": { "format": "int64", "description": "The sender user Id.", "type": "integer" }, "sourceUniverseId": { "format": "int64", "description": "The source universe Id which the request was sent in.", "type": "integer" }, "originSourceType": { "format": "int32", "description": "The origin source type associated with the friend request. ['Unknown' = 0, 'PlayerSearch' = 1, 'QrCode' = 2, 'InGame' = 3, 'UserProfile' = 4, 'QqContactImporter' = 5, 'WeChatContactImporter' = 6, 'ProfileShare' = 7, 'PhoneContactImporter' = 8, 'FriendRecommendations' = 9]", "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "type": "integer" }, "contactName": { "description": "The contact name associated with the friend request.", "type": "string" }, "senderNickname": { "description": "The nickname associated with the friend request.", "type": "string" } } }, "Roblox.Friends.Api.FriendRequestResponse": { "description": "A response model representing a friend request.", "type": "object", "properties": { "friendRequest": { "ref": "#/definitions/Roblox.Friends.Api.FriendRequest" }, "mutualFriendsList": { "description": "mutualFriendsList", "type": "array", "items": { "type": "string" } }, "hasVerifiedBadge": { "description": "The user's verified badge status.", "type": "boolean" }, "description": { "type": "string" }, "created": { "format": "date-time", "type": "string" }, "isBanned": { "type": "boolean" }, "externalAppDisplayName": { "type": "string" }, "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" }, "displayName": { "type": "string" } } }, "Roblox.Friends.Api.FriendStatusResponse": { "description": "The friendship status response model.", "type": "object", "properties": { "id": { "format": "int64", "description": "The user Id of the friend.", "type": "integer" }, "status": { "format": "int32", "description": "The friendship status. ['NotFriends' = 0, 'Friends' = 1, 'RequestSent' = 2, 'RequestReceived' = 3]", "enum": [ 0, 1, 2, 3 ], "type": "integer" } } }, "Roblox.Friends.Api.FriendsCountResponse": { "description": "Response model for Friends Count", "type": "object", "properties": { "count": { "format": "int32", "description": "Count of friends", "type": "integer" } } }, "Roblox.Friends.Api.FriendshipRequestModel": { "type": "object", "properties": { "friendshipOriginSourceType": { "format": "int32", "description": "Which source the friend request originated from ['Unknown' = 0, 'PlayerSearch' = 1, 'QrCode' = 2, 'InGame' = 3, 'UserProfile' = 4, 'QqContactImporter' = 5, 'WeChatContactImporter' = 6, 'ProfileShare' = 7, 'PhoneContactImporter' = 8, 'FriendRecommendations' = 9]", "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "type": "integer" }, "senderNickname": { "description": "Optional nickname attached to friend request", "type": "string" } } }, "Roblox.Friends.Api.Models.Request.FriendingTokenRequestModel": { "description": "Request model for AcceptFriendRequestWithToken endpoint", "type": "object", "properties": { "friendingToken": { "description": "FriendingToken to authorize the creation of an Off Network Friend request", "type": "string" } } }, "Roblox.Friends.Api.Models.Response.DeclineAllFriendRequestsResponse": { "description": "response for DeclineAllFriendRequests", "type": "object", "properties": { "backgrounded": { "description": "Whether or not the decline all job has been backgrounded", "type": "boolean" } } }, "Roblox.Friends.Api.Models.Response.FollowingExistsResponse": { "description": "Response contained in list for FollowingExists endpoint. Corresponds to a single userId.", "type": "object", "properties": { "isFollowing": { "description": "Whether or not a user is following userId in FriendsController.FollowingExists", "type": "boolean" }, "isFollowed": { "description": "Whether or not a user is followed by userId in FriendsController.FollowingExists", "type": "boolean" }, "userId": { "format": "int64", "description": "The userId being potentially followed", "type": "integer" } } }, "Roblox.Friends.Api.Models.Response.FollowingExistsResponseModel": { "description": "Response model for FollowingExists endpoint.", "type": "object", "properties": { "followings": { "description": "A list of userIds and whether or not the given user is following them.", "type": "array", "items": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.FollowingExistsResponse" } } } }, "Roblox.Friends.Api.Models.Response.FriendResponse": { "description": "A response model representing friend information", "type": "object", "properties": { "id": { "format": "int64", "description": "The friend's userId", "type": "integer" }, "hasVerifiedBadge": { "description": "The friend's verified badge status.", "type": "boolean" } } }, "Roblox.Friends.Api.Models.Response.FriendsPageMetadataResponse": { "type": "object", "properties": { "isFriendsFilterBarEnabled": { "type": "boolean", "readOnly": true }, "isFriendsPageSortExperimentEnabled": { "type": "boolean", "readOnly": true }, "isFriendsUserDataStoreCacheEnabled": { "type": "boolean", "readOnly": true }, "frequentFriendSortRollout": { "format": "int32", "type": "integer", "readOnly": true }, "userName": { "type": "string" }, "displayName": { "type": "string" } } }, "Roblox.Friends.Api.Models.Response.UserPresenceResponse": { "description": "A response model representing user presence information.", "type": "object", "properties": { "userPresence": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.UserPresenceResponseModel" }, "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" }, "displayName": { "type": "string" } } }, "Roblox.Friends.Api.Models.Response.UserPresenceResponseModel": { "description": "Response model for Roblox.Web.Presence.Interfaces.IUserPresence objects", "type": "object", "properties": { "UserPresenceType": { "description": "User Presence Type", "type": "string" }, "UserLocationType": { "description": "Location Type", "type": "string" }, "lastLocation": { "description": "Last Location", "type": "string" }, "placeId": { "format": "int64", "description": "Place Id", "type": "integer" }, "rootPlaceId": { "format": "int64", "description": "Root Place Id", "type": "integer" }, "gameInstanceId": { "format": "uuid", "description": "Game Instance Id", "type": "string" }, "universeId": { "format": "int64", "type": "integer" }, "lastOnline": { "format": "date-time", "description": "Most recent time online", "type": "string" } } }, "Roblox.Friends.Api.Models.Response.UserResponse": { "description": "A response model representing user information that also contains select presence information", "type": "object", "properties": { "isOnline": { "description": "Whether the user is online.", "type": "boolean" }, "presenceType": { "format": "int32", "description": "Where the user is online. ['Offline' = 0, 'Online' = 1, 'InGame' = 2, 'InStudio' = 3, 'Invisible' = 4]", "enum": [ 0, 1, 2, 3, 4 ], "type": "integer" }, "isDeleted": { "description": "Whether the user is deleted.", "type": "boolean" }, "friendFrequentScore": { "format": "int64", "description": "Frequents value for the user.", "type": "integer" }, "friendFrequentRank": { "format": "int64", "description": "Frequents rank for the user.", "type": "integer" }, "hasVerifiedBadge": { "description": "The user's verified badge status.", "type": "boolean" }, "description": { "type": "string" }, "created": { "format": "date-time", "type": "string" }, "isBanned": { "type": "boolean" }, "externalAppDisplayName": { "type": "string" }, "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" }, "displayName": { "type": "string" } } }, "Roblox.Friends.Api.MultigetAreFriendsRequestModel": { "description": "Request model for MultigetAreFriends endpoint", "type": "object", "properties": { "targetUserIds": { "description": "The target userIds to check against with the requesting user regarding friendship.", "type": "array", "items": { "format": "int64", "type": "integer" } } } }, "Roblox.Friends.Api.PendingFriendRequestCountModel": { "description": "Response model for Pending Friend Request Count", "type": "object", "properties": { "count": { "format": "int32", "description": "Count of pending friend requests", "type": "integer" } } }, "Roblox.Paging.CursoredPagedResult[Roblox.Friends.Api.Models.Response.FriendResponse]": { "type": "object", "properties": { "PreviousCursor": { "type": "string" }, "PageItems": { "type": "array", "items": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.FriendResponse" } }, "NextCursor": { "type": "string" }, "HasMore": { "type": "boolean" } } }, "Roblox.Paging.ExclusiveStartKeyCursor[System.String]": { "type": "object", "properties": { "key": { "type": "string" }, "sortOrder": { "format": "int32", "description": " ['Asc' = 1, 'Desc' = 2]", "enum": [ 1, 2 ], "type": "integer" }, "pagingDirection": { "format": "int32", "description": " ['Forward' = 1, 'Backward' = 2]", "enum": [ 1, 2 ], "type": "integer" }, "pageNumber": { "format": "int32", "type": "integer" }, "discriminator": { "type": "string" }, "count": { "format": "int32", "type": "integer" } } }, "Roblox.Platform.Core.ExclusiveStartPaging.IExclusiveStartKeyInfo[Roblox.Web.Friends.FriendRequestsPlatformExclusiveStartKey]": { "type": "object", "properties": { "SortOrder": { "format": "int32", "description": " ['Asc' = 1, 'Desc' = 2]", "enum": [ 1, 2 ], "type": "integer", "readOnly": true }, "PagingDirection": { "format": "int32", "description": " ['Forward' = 1, 'Backward' = 2]", "enum": [ 1, 2 ], "type": "integer", "readOnly": true }, "Count": { "format": "int32", "type": "integer", "readOnly": true } } }, "Roblox.Platform.Core.ExclusiveStartPaging.IExclusiveStartKeyInfo[System.Int64]": { "type": "object", "properties": { "SortOrder": { "format": "int32", "description": " ['Asc' = 1, 'Desc' = 2]", "enum": [ 1, 2 ], "type": "integer", "readOnly": true }, "PagingDirection": { "format": "int32", "description": " ['Forward' = 1, 'Backward' = 2]", "enum": [ 1, 2 ], "type": "integer", "readOnly": true }, "Count": { "format": "int32", "type": "integer", "readOnly": true } } }, "Roblox.Web.Captcha.Models.Request.CaptchaTokenRequest": { "type": "object", "properties": { "captchaId": { "type": "string" }, "captchaToken": { "type": "string" }, "captchaProvider": { "type": "string" }, "challengeId": { "type": "string" } } }, "Roblox.Web.WebAPI.ApiEmptyResponseModel": { "type": "object" }, "Roblox.Web.WebAPI.ExclusiveStartRequest[Roblox.Web.Friends.FriendRequestsPlatformExclusiveStartKey]": { "type": "object", "properties": { "ExclusiveStartKeyInfo": { "ref": "#/definitions/Roblox.Platform.Core.ExclusiveStartPaging.IExclusiveStartKeyInfo[Roblox.Web.Friends.FriendRequestsPlatformExclusiveStartKey]" }, "CursorRecipe": { "type": "string" } } }, "Roblox.Web.WebAPI.ExclusiveStartRequest[System.Int64]": { "type": "object", "properties": { "ExclusiveStartKeyInfo": { "ref": "#/definitions/Roblox.Platform.Core.ExclusiveStartPaging.IExclusiveStartKeyInfo[System.Int64]" }, "CursorRecipe": { "type": "string" } } }, "Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Friends.Api.FriendStatusResponse]": { "type": "object", "properties": { "data": { "type": "array", "items": { "ref": "#/definitions/Roblox.Friends.Api.FriendStatusResponse" } } } }, "Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Friends.Api.Models.Response.UserPresenceResponse]": { "type": "object", "properties": { "data": { "type": "array", "items": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.UserPresenceResponse" } } } }, "Roblox.Web.WebAPI.Models.ApiArrayResponse[Roblox.Friends.Api.Models.Response.UserResponse]": { "type": "object", "properties": { "data": { "type": "array", "items": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.UserResponse" } } } }, "Roblox.Web.WebAPI.Models.ApiPageResponse[Roblox.Friends.Api.FriendRequestResponse]": { "type": "object", "properties": { "previousPageCursor": { "type": "string" }, "nextPageCursor": { "type": "string" }, "data": { "type": "array", "items": { "ref": "#/definitions/Roblox.Friends.Api.FriendRequestResponse" } } } }, "Roblox.Web.WebAPI.Models.ApiPageResponse[Roblox.Friends.Api.Models.Response.UserResponse]": { "type": "object", "properties": { "previousPageCursor": { "type": "string" }, "nextPageCursor": { "type": "string" }, "data": { "type": "array", "items": { "ref": "#/definitions/Roblox.Friends.Api.Models.Response.UserResponse" } } } }, "System.ValueTuple[Roblox.Web.WebAPI.ExclusiveStartRequest[System.Int64],Roblox.Paging.ExclusiveStartKeyCursor[System.String]]": { "type": "object", "properties": { "Item1": { "ref": "#/definitions/Roblox.Web.WebAPI.ExclusiveStartRequest[System.Int64]" }, "Item2": { "$ref": "#/definitions/Roblox.Paging.ExclusiveStartKeyCursor[System.String]" } } } } } - Assistant
To build a fully-fledged website and scraper for the Roblox Friends API in Rust, you can create a web application that allows users to check if a given user is friends with another user (for example, David Baszucki). Below is a sample Rust application that uses Actix-web as the web framework and leverages the Roblox API to check friendship status.
Step 1: Set Up the Project
First, ensure you have Rust installed. If not, you can download it from https://www.rust-lang.org/tools/install.
Create a new Rust project:
cargo new roblox_friendship_checker cd roblox_friendship_checkerStep 2: Update
Cargo.tomlDependenciesAdd the following dependencies to your
Cargo.tomlfile:[dependencies] actix-web = "4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" reqwest = { version = "0.11", features = ["json", "gzip"] }Step 3: Implement the Application
Replace the contents of
src/main.rswith the following code:use actix_web::{web, App, HttpResponse, HttpServer, Responder}; use serde::Deserialize; use serde_json::Value; #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| { App::new() .route("/", web::get().to(index)) .route("/check_friendship", web::post().to(check_friendship)) }) .bind("127.0.0.1:8080")? .run() .await } async fn index() -> impl Responder { let html = r#" <html> <head><title>Roblox Friendship Checker</title></head> <body> <h1>Roblox Friendship Checker</h1> <form action="/check_friendship" method="post"> <label for="user_id">Enter User ID or Username:</label> <input type="text" id="user_id" name="user_id"><br><br> <label for="target_user_id">Enter Target User ID or Username:</label> <input type="text" id="target_user_id" name="target_user_id" value="1"><br><br> <input type="submit" value="Check Friendship"> </form> </body> </html> "#; HttpResponse::Ok().content_type("text/html").body(html) } #[derive(Deserialize)] struct FriendshipCheck { user_id: String, target_user_id: String, } async fn check_friendship(form: web::Form<FriendshipCheck>) -> impl Responder { let user_id_input = &form.user_id; let target_user_id_input = &form.target_user_id; // Resolve usernames to user IDs if necessary let user_id = match resolve_user_id(user_id_input).await { Ok(id) => id, Err(e) => return HttpResponse::BadRequest().body(format!("Error: {}", e)), }; let target_user_id = match resolve_user_id(target_user_id_input).await { Ok(id) => id, Err(e) => return HttpResponse::BadRequest().body(format!("Error: {}", e)), }; // Check friendship status match are_friends(user_id, target_user_id).await { Ok(true) => { let user_name = &form.user_id; let target_user_name = &form.target_user_id; HttpResponse::Ok() .content_type("text/html") .body(format!("User <strong>{}</strong> is friends with user <strong>{}</strong>.", user_name, target_user_name)) } Ok(false) => { let user_name = &form.user_id; let target_user_name = &form.target_user_id; HttpResponse::Ok() .content_type("text/html") .body(format!("User <strong>{}</strong> is NOT friends with user <strong>{}</strong>.", user_name, target_user_name)) } Err(e) => HttpResponse::InternalServerError().body(format!("Error: {}", e)), } } // Function to resolve username to user ID async fn resolve_user_id(user_identifier: &str) -> Result<u64, Box<dyn std::error::Error>> { if let Ok(id) = user_identifier.parse::<u64>() { Ok(id) } else { // Assume it's a username, resolve to user ID let url = format!( "https://api.roblox.com/users/get-by-username?username={}", user_identifier ); let client = reqwest::Client::new(); let res = client.get(&url).send().await?; if res.status().is_success() { let data: Value = res.json().await?; if data.get("success").is_some() && data["success"].as_bool() == Some(false) { Err(format!("User '{}' not found", user_identifier).into()) } else if let Some(id) = data["Id"].as_u64() { Ok(id) } else { Err("Unexpected response format".into()) } } else { Err("Failed to resolve username".into()) } } } async fn are_friends(user_id: u64, target_user_id: u64) -> Result<bool, Box<dyn std::error::Error>> { let url = format!("https://api.roblox.com/users/{}/friends", user_id); let client = reqwest::Client::new(); let res = client.get(&url).send().await?; if res.status().is_success() { let data: Value = res.json().await?; if let Some(friends_array) = data.as_array() { for friend in friends_array { if friend["Id"].as_u64() == Some(target_user_id) { return Ok(true); } } Ok(false) } else { Err("Invalid response format".into()) } } else { Err("Failed to retrieve friends list".into()) } }Explanation:
-
Dependencies:
actix-web: Used for the web server framework.serdeandserde_json: For JSON serialization/deserialization.reqwest: For making HTTP requests to the Roblox API.
-
Index Route (
/):- Displays an HTML form where users can enter a User ID or Username and check if they are friends with the target user.
-
Check Friendship Handler (
/check_friendship):- Retrieves the form data.
- Uses the
resolve_user_idfunction to convert usernames to User IDs. - Calls
are_friendsto check if the two users are friends. - Returns the result in an HTML response.
-
Resolving Usernames to User IDs:
- If the input is not a number, the code assumes it's a username.
- It sends a GET request to
https://api.roblox.com/users/get-by-usernameto resolve the username to a User ID.
-
Checking Friendship Status:
- Fetches the friends list of the user using
https://api.roblox.com/users/{userId}/friends. - Iterates through the friends list to see if the target user is a friend.
- Fetches the friends list of the user using
Note:
- The
api.roblox.comendpoints used in this code are accessible without authentication and can be used to retrieve public information. - The public APIs may have limitations or may be deprecated in the future. Always check the latest Roblox API documentation and terms of service to ensure compliance.
Step 4: Run the Application
Build and run the application:
cargo runYou should see output similar to:
Listening on http://127.0.0.1:8080Open your web browser and navigate to
http://127.0.0.1:8080.Step 5: Use the Website
- Check Friendship with David Baszucki:
- David Baszucki's User ID:
1 - David Baszucki's Username:
Builderman
- David Baszucki's User ID:
Enter a User ID or Username in the first field and
1orBuildermanin the second field. Click "Check Friendship" to see if they are friends.Example:
-
Input:
User ID or Username: SomeUser123 Target User ID or Username: Builderman -
Output:
User SomeUser123 is NOT friends with user Builderman.
Additional Features:
You can extend this application by:
- Adding Styling: Use CSS to improve the visual appearance.
- Error Handling: Provide more detailed error messages.
- Caching Results: Implement caching to reduce API calls for frequently checked users.
- Asynchronous Requests: Allow users to check multiple friendships simultaneously.
Disclaimer:
- Ensure that your application complies with Roblox's API usage policies and terms of service.
- Be mindful of rate limits and avoid overloading the API with excessive requests.
- This application uses public endpoints that may change or be deprecated. Always refer to the official Roblox API documentation for updates.
Conclusion:
You've now created a Rust-based web application that checks the friendship status between two Roblox users using the Friends API. This serves as a foundation for building more advanced tools and applications interacting with Roblox's platform.
Feel free to customize and expand upon this code to suit your specific needs!
-