You can use the capture-recapture method, also implemented as the Rcapture R package.
Here is an example, coded in R. Let's assume that the web service has N=1000 items. We will make n=300 requests. Generate a random sample where, numbering the elements from 1 to k, where k is how many different items we saw.
N = 1000; population = 1:N # create a population of the integers from 1 to 1000
n = 300 # number of requests
set.seed(20110406)
observation = as.numeric(factor(sample(population, size=n,
replace=TRUE))) # a random sample from the population, renumbered
table(observation) # a table useful to see, not discussed
k = length(unique(observation)) # number of unique items seen
(t = table(table(observation)))
The result of the simulation is
1 2 3
234 27 4
thus among the 300 requests there were 4 items seen 3 times, 27 items seen twice, and 234 items seen only once.
Now estimate N from this sample:
require(Rcapture)
X = data.frame(t)
X[,1]=as.numeric(X[,1])
desc=descriptive(X, dfreq=TRUE, dtype="nbcap", t=300)
desc # useful to see, not discussed
plot(desc) # useful to see, not discussed
cp=closedp.0(X, dfreq=TRUE, dtype="nbcap", t=300, trace=TRUE)
cp
The result:
Number of captured units: 265
Abundance estimations and model fits:
abundance stderr deviance df AIC
M0** 265.0 0.0 2.297787e+39 298 2.297787e+39
Mh Chao 1262.7 232.5 7.840000e-01 9 5.984840e+02
Mh Poisson2** 265.0 0.0 2.977883e+38 297 2.977883e+38
Mh Darroch** 553.9 37.1 7.299900e+01 297 9.469900e+01
Mh Gamma3.5** 5644623606.6 375581044.0 5.821861e+05 297 5.822078e+05
** : The M0 model did not converge
** : The Mh Poisson2 model did not converge
** : The Mh Darroch model did not converge
** : The Mh Gamma3.5 model did not converge
Note: 9 eta parameters has been set to zero in the Mh Chao model
Thus only the Mh Chao model converged, it estimated N^=1262.7.
EDIT: To check the reliability of the above method I ran the above code on 10000 generated samples. The Mh Chao model converged every time. Here is the summary:
> round(quantile(Nhat, c(0, 0.025, 0.25, 0.50, 0.75, 0.975, 1)), 1)
0% 2.5% 25% 50% 75% 97.5% 100%
657.2 794.6 941.1 1034.0 1144.8 1445.2 2162.0
> mean(Nhat)
[1] 1055.855
> sd(Nhat)
[1] 166.8352