City officials unveiled Grade.DC.gov in early June as part of a three-year, $500,000 contract with newBrandAnalytics, a D.C.-based company that promotes itself as “the global leader in social market intelligence.”

For the city government, the firm collects reviews and “insights” from online surveys and select social media platforms such as Facebook, Twitter and the comment sections of five area blogs, said Zach Boisi, the company’s client services director. Analysts use an algorithm to convert the feedback into a score and a letter grade.

The city has been gauging the DMV, DPW, Department of Transportation, Department of Parks and Recreation and the Department of Consumer and Regulatory Affairs for about a month and will add 10 agencies in the fall, officials said.

Former Mayor Anthony A. Williams established a “scorecard” system as he brought the District back from the financial brink and restored faith in city services in the late 1990s. His successor, Adrian M. Fenty, also relied on data for his reform-driven agenda and rolled out initiatives such as the track.dc.gov website and CapStat program to promote government accountability.

Now Mr. Gray is rolling out his form of agency report cards more than a year into his term. The initiative is based on a meeting his administration had with newBrandAnalytics last year, when it persuaded the company to stay in the District instead of moving to Silicon Valley in California, mayoral spokesman Pedro Ribeiro, said.

The mayor thought its technology — actively seeking feedback from the Web that is not necessarily solicited — could be a good fit for government oversight.

“Nobody’s tried this before,” Mr. Gray said, noting that Prince George’s County officials have inquired about the program.

Mr. Gray said he is following through on a promise he made in his State of the District Address earlier this year to ensure that city residents get a significant return on their tax dollars.

The rollout of the slightly improving grades comes at a difficult time for Mr. Gray, who faces questions on a near-daily basis about a “shadow” campaign that spent at least $650,000 to support his bid for mayor in 2010, whether he knew it or not.

Mr. Gray said the agencies’ grades should not be confused with ratings of his performance as mayor, which have suffered amid a trickle of reports about underhanded deeds by his campaign.

“I think they’re very different measures,” he said.

Officials from newBrandAnalytics said it is difficult to track whether feedback is coming from employees of the agencies themselves, but they assured the public on Tuesday that the company uses the same controls on Grade.DC.gov as it does for its private-sector clients and would never manipulate its data for political aims.

George T. Johnson, executive director of the American Federation of State, County and Municipal Employees District Council 20, said the feedback is an innovative tool spearheaded by “one of the greatest mayors in the world.”

A prominent union leader, Mr. Johnson said he has seen services “go from one level to a totally different level” over the span of more than 60 years in the District and he would not promote Grade.DC.gov if he had not seen improvement during its short existence.

“It’s not a snitching line,” he said. “It’s a line that allows people to understand their grade.”

Four of the five agencies have seen small gains since early June, with the Department of Motor Vehicles holding at C-, transportation and consumer affairs departments each improved from C- to C+, public works from C+ to B, and parks from C- to a C.

DPW Director William O. Howland Jr. said the agency’s clean-up performance after the June 29 derecho that swept through the capital region likely improved its score during the five weeks that the feedback system has been in operation.

Notably, the data has shown that city residents tend to both praise and complain about the same thing, such as the expertise of agency personnel and time spent waiting in line for services. Mr. Gray said it could be a sign that some employees pull their weight while others do not.

Mr. Boisi said the company attempts to extrapolate data from specific locations, for instance a DMV location that is named in a review.

“Some of [the comments] actually singled out a person or two at one of the agencies by description,” Mr. Gray said. “And I’m sure, in that particular instance, that the director is going to pay close attention to that situation.”