You can use webapi to retrieve the values and labels from particular optionsset, which will return the data in JSON format.
The following webapi call will return the accountcategorycode values in json format for the account entity, You can do the manipulation after that:
orgname.contoso.com/.../EntityDefinitions(LogicalName='account')/Attributes(LogicalName='accountcategorycode')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet($select=Options),GlobalOptionSet($select=Options)
This will return the following:
{ "@odata.context":"orgname.contoso.com/.../v8.2$metadata#EntityDefinitions('account')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata(LogicalName,OptionSet,GlobalOptionSet,OptionSet(Options),GlobalOptionSet(Options))/$entity","LogicalName":"accountcategorycode","MetadataId":"118771ca-6fb9-4f60-8fd4-99b6124b63ad","OptionSet@odata.context":"orgname.contoso.com/.../v8.2$metadata#EntityDefinitions('account'#/Attributes#118771ca-6fb9-4f60-8fd4-99b6124b63ad)/Microsoft.Dynamics.CRM.PicklistAttributeMetadata/OptionSet(Options)/$entity","OptionSet":{ "Options":[ { "Value":1,"Label":{ "LocalizedLabels":[ { "Label":"Preferred Customer","LanguageCode":1033,"IsManaged":true,"MetadataId":"0bd8a218-2341-db11-898a-0007e9e17ebd","HasChanged":null } ],"UserLocalizedLabel":{ "Label":"Preferred Customer","LanguageCode":1033,"IsManaged":true,"MetadataId":"0bd8a218-2341-db11-898a-0007e9e17ebd","HasChanged":null } },"Description":{ "LocalizedLabels":[ ],"UserLocalizedLabel":null },"Color":null,"IsManaged":true,"MetadataId":null,"HasChanged":null },{ "Value":2,"Label":{ "LocalizedLabels":[ { "Label":"Standard","LanguageCode":1033,"IsManaged":true,"MetadataId":"0dd8a218-2341-db11-898a-0007e9e17ebd","HasChanged":null } ],"UserLocalizedLabel":{ "Label":"Standard","LanguageCode":1033,"IsManaged":true,"MetadataId":"0dd8a218-2341-db11-898a-0007e9e17ebd","HasChanged":null } },"Description":{ "LocalizedLabels":[ ],"UserLocalizedLabel":null },"Color":null,"IsManaged":true,"MetadataId":null,"HasChanged":null } ],"MetadataId":"b994cdd8-5ce9-4ab9-bdd3-8888ebdb0407" },"GlobalOptionSet":null }
Hope this helps.