<p><a href="http://blockexplorer.com/q/nethash/2016" rel="nofollow">http://blockexplorer.com/q/nethash/2016</a> provides the necessary information and shouldn't be too hard to parse. Every row corresponds to the first block at a given difficulty.</p>

CC BY-SA 4.0
2022-08-06T19:09:36.683Z
This link no longer works (404)
RedGrittyBrick
CC BY-SA 3.0
2011-11-30T21:00:37.210Z
You can also use http://blockexplorer.com/q/nethash/2015
theymos
CC BY-SA 3.0
2011-12-01T06:52:17.070Z
This should probably be http://blockexplorer.com/q/nethash/2016 . The interval between successive retargets is 2016 blocks, and this also gives the correct offset - every row is the first block of every difficulty. I've edited the answer to use this improvement.
Meni Rosenfeld
CC BY-SA 3.0
2011-12-01T09:06:57.157Z
Actually, I think that the last block of each difficulty is at 2015. This means that http://blockexplorer.com/q/nethash/2015 has the correct timestamp, but I have to use the difficulty of the following block. It's a little tricky...
nmat
CC BY-SA 3.0
2011-12-01T13:48:47.760Z
/2015 isn't good because it's not the right interval. If you want the last block of every difficulty you need 2015, 4031, 6047... But /2015 will give you 2015, 4030, 6045... . Unless there's a parameter for nethash to control the offset (or theymos is willing to add one) it can't be used for this. But you can query each block separately with e.g. http://blockexplorer.com/b/155231 .

Anyway, why do you want the timestamp of the last block of a difficulty rather than the first block of the next difficulty?
Meni Rosenfeld
CC BY-SA 3.0
2011-12-01T16:42:12.700Z
Hum.. I thought that difficulty actually changed when block 2015 came out because the next block will be mined with the new difficulty. No? Anyway, it's probably a 10min difference so it isn't worth the trouble. Thanks for the help.
nmat
CC BY-SA 3.0
2011-12-01T18:58:42.823Z
@nmat: This makes sense, you do want the block at the -1 offset. But you still need a 2016 interval, which /nethash/2015 doesn't provide. If you don't need it very accurate you can just use /2016, and to gain a bit more accuracy you could subtract 10 minutes which is the average difference between this block and the previous one.
Meni Rosenfeld
CC BY-SA 3.0
2011-11-30T08:56:59.583Z
2011-12-01T06:52:09.830Z
2011-12-01T06:52:09.830Z
Meni Rosenfeld
<p>I am looking for a website that allows me to retrieve the time at which each difficulty change happened. The time doesn't need to be accurate so a time stamp from the block will do. I want to fetch this information automatically every now and then, but I can't seem to find a webpage that provides an API for this.</p>

<development><difficulty>
Web API to retrieve difficulty changes
nmat
# Web API to retrieve difficulty changes

(Asked by: username_0 on 2011-11-30)

I am looking for a website that allows me to retrieve the time at which each difficulty change happened. The time doesn't need to be accurate so a time stamp from the block will do. I want to fetch this information automatically every now and then, but I can't seem to find a webpage that provides an API for this.

**Tags:** development, difficulty


---

## 1 answers

### Answer by username_1 on 2011-11-30. Score: 3 | Accepted answer

<http://blockexplorer.com/q/nethash/2016> provides the necessary information and shouldn't be too hard to parse. Every row corresponds to the first block at a given difficulty.

> **Comments:**
> **username_3**: You can also use http://blockexplorer.com/q/nethash/2015  
> **username_1**: This should probably be http://blockexplorer.com/q/nethash/2016 . The interval between successive retargets is 2016 blocks, and this also gives the correct offset - every row is the first block of every difficulty. I've edited the answer to use this improvement.  
> **username_0**: Actually, I think that the last block of each difficulty is at 2015. This means that http://blockexplorer.com/q/nethash/2015 has the correct timestamp, but I have to use the difficulty of the following block. It's a little tricky...  
> **username_1**: /2015 isn't good because it's not the right interval. If you want the last block of every difficulty you need 2015, 4031, 6047... But /2015 will give you 2015, 4030, 6045... . Unless there's a parameter for nethash to control the offset (or username_3 is willing to add one) it can't be used for this. But you can query each block separately with e.g. http://blockexplorer.com/b/155231 .  Anyway, why do you want the timestamp of the last block of a difficulty rather than the first block of the next difficulty?  
> **username_0**: Hum.. I thought that difficulty actually changed when block 2015 came out because the next block will be mined with the new difficulty. No? Anyway, it's probably a 10min difference so it isn't worth the trouble. Thanks for the help.  
> **username_1**: @username_0: This makes sense, you do want the block at the -1 offset. But you still need a 2016 interval, which /nethash/2015 doesn't provide. If you don't need it very accurate you can just use /2016, and to gain a bit more accuracy you could subtract 10 minutes which is the average difference between this block and the previous one.  
> **username_2**: This link no longer works (404)  

---

