— [ API Service ] —
The current main methods include the following:
RobloxAPI: Returns table of Roblox’s API dump.
GetProperties(<Instance>, <boolean> writableOnly): Returns readable properties. ([Name]=Value)
(Returns writable-only properties if second argument is true. Default is false.)
GetProperties(<string> ClassName, <boolean> writableOnly (Optional) ): Returns readable properties. (Name only)
(Returns writable-only properties if second argument is true. Default is false.)
GetFunctions(<Instance>): Returns readable functions. ([Name]=Value)
GetEvents(<Instance>): Returns readable events. ([Name]=Value)
GetClassIcon(<Instance>/<string> ClassName): Returns Icon data for class. Result is the same as StudioService:GetClassIcon().
GetClassIconV2(<Instance>/<string> ClassName, <string> mode (Dark/Light) (Optional), <number> scale (1-3) (Optional) ):
Returns the icon image for class.
(Not to be confused with GetClassIcon
or StudioService:GetClassIcon()
.)
GetRawClassData(<string> ClassName): Returns class data for given ClassName from the API dump.
GetRawSuperclassMembers(<string> ClassName): Returns all superclass members for given ClassName from the API dump.
GetRawSuperclassProperties(<string> ClassName): Returns all superclass properties for given ClassName from the API dump.
JSONEncodeValue(<DataType/Property>): Encodes value for use in JSONEncoding.
JSONDecodeValue(<DataType/Property>): Decodes encoded value from JSON string format. Only compatible with interal “JSONEncodeValue”.
Serialize(<Instance>, <boolean> getDescendants, <boolean> ignoreScripts): Serializes an instance (and descendants if enabled) into a string format.
(If second argument is true, descendants of the instance will also be serialized. Default is true.)
(If third argument is true, script source code will be ignored. Default is false.)
Deserialize(<Instance>): Returns deserialized instance (and descendants if any). Only compatible with interal serialization.
PrintVersion(<void>): Prints all version information in “Output”.
DeveloperVersion: Version number of release.
DumpVersion: Version of API dump. (Not the version of Roblox API)
LuaVersion: Returns Lua version used at time of version release.
CreatorId: Returns the UserId of “API Service” (ModuleScript) developer.
PrintCredits(<void>): Prints credits in “Output”.
Test(<void>): Returns “true” if base and required ModuleScripts have been required correctly.
Constructors: Table of basic constructors. (Mainly used for internal operations.)
Attributes of APIService:
IgnoreUpdates: If true, update warnings will no longer appear in the output.
local API = require(7995685995) -- Or replace with path to module
local properties = API:GetProperties(workspace:WaitForChild('SpawnLocation'))
for name,value in pairs(properties) do
print(name,value)
end
Output:
{
["AllowTeamChangeOnTouch"] = false,
["Anchored"] = true,
["Archivable"] = true,
["AssemblyAngularVelocity"] = 0, 0, 0,
["AssemblyCenterOfMass"] = -5.96046448e-08, 0.25, -1.1920929e-07,
["AssemblyLinearVelocity"] = 0, 0, 0,
["AssemblyMass"] = inf,
["AssemblyRootPart"] = SpawnLocation,
["BackParamA"] = -0.5,
["BackParamB"] = 0.5,
["BackSurface"] = Smooth,
["BackSurfaceInput"] = NoInput,
["BottomParamA"] = -0.5,
["BottomParamB"] = 0.5,
["BottomSurface"] = Smooth,
["BottomSurfaceInput"] = NoInput,
["BrickColor"] = Medium stone grey,
["CFrame"] = -5.96046448e-08, 0.25, -1.1920929e-07, 1, 0, 0, 0, 1, 0, 0, 0, 1,
["CanCollide"] = true,
["CanQuery"] = true,
["CanTouch"] = true,
["CastShadow"] = true,
["CenterOfMass"] = 0, 0, 0,
["ClassName"] = "SpawnLocation",
["CollisionGroupId"] = 0,
["Color"] = 0.639216, 0.635294, 0.647059,
["Duration"] = 0,
["Elasticity"] = 0.5,
["Enabled"] = true,
["FormFactor"] = Brick,
["Friction"] = 0.300000011920929,
["FrontParamA"] = -0.5,
["FrontParamB"] = 0.5,
["FrontSurface"] = Smooth,
["FrontSurfaceInput"] = NoInput,
["LeftParamA"] = -0.5,
["LeftParamB"] = 0.5,
["LeftSurface"] = Smooth,
["LeftSurfaceInput"] = NoInput,
["LocalTransparencyModifier"] = 0,
["Locked"] = false,
["Mass"] = 5.599999904632568,
["Massless"] = false,
["Material"] = Plastic,
["Name"] = "SpawnLocation",
["Neutral"] = true,
["Orientation"] = 0, 0, 0,
["Parent"] = Workspace,
["PivotOffset"] = 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
["Position"] = -5.96046448e-08, 0.25, -1.1920929e-07,
["ReceiveAge"] = 0,
["Reflectance"] = 0,
["ResizeIncrement"] = 1,
["ResizeableFaces"] = Right, Top, Back, Left, Bottom, Front,
["RightParamA"] = -0.5,
["RightParamB"] = 0.5,
["RightSurface"] = Smooth,
["RightSurfaceInput"] = NoInput,
["RootPriority"] = 0,
["RotVelocity"] = 0, 0, 0,
["Rotation"] = 0, 0, 0,
["Shape"] = Block,
["Size"] = 4, 0.5, 4,
["SpecificGravity"] = 0.699999988079071,
["TeamColor"] = Medium stone grey,
["TopParamA"] = -0.5,
["TopParamB"] = 0.5,
["TopSurface"] = Smooth,
["TopSurfaceInput"] = NoInput,
["Transparency"] = 0,
["Velocity"] = 0, 0, 0,
["archivable"] = true,
["brickColor"] = Medium stone grey,
["className"] = "SpawnLocation",
["formFactor"] = Brick
}
(Technically it would print a bit differently, but this output example looks nicer).
When required, it will automatically make a check to see if it’s up-to-date. However it won’t auto-update.
Downloads:
API Service - Model page
- The model version does not include the API dump. Use the tool mentioned below.
Setup:
- Run the tool
- Make sure “JSON” is the selected format
- Check the box for “Full Dump”
- Click “View API Dump”
- Copy all of that text
- Open your experience and insert the API Service module if you haven’t already
- Go to the “API” module within the main main module
- Look for the section that looks like the following:
local json = [[
]] -- Paste the JSON API dump into the line above.
- Paste the JSON in the empty space in the middle
- You should be all set
API Service.rbxm (348.4 KB) - Direct download
This was my first attempt at something like this. Let me know if there are any other features you’d like to see included in this module.
Also credits to this tool for generating the API dump.